Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have three machines,two of them are CentOS,the third machine's OS is FreeBSD.
Now I want to use one CentOS machine to backup the another CentOS and the FreeBSD.
Use the SSH can connect between the two CentOS machine,but can't connect to the FreeBSD.
----------------------------------------------------------------
<1>The first machine(CentOS use to backup the other two machine)
IP:114.80.x.x UserName:dyadmin
ssh port:22
#Protocol 2
use the ssh-keygen I have created the id_rsa and id_rsa.pub in the /home/dyadmin/.ssh
And copy the rsa.pub to the other two servers,renamed to authorized_keys
/home/dingyong/.ssh (700)
/home/dyadmin/.ssh/id_rsa (600)
/home/dyadmin/.ssh/id_rsa.pub (644)
----------------------------------------------------------------
<2>The second machine(CentOS)
IP:180.178.x.x UserName:dingyong
ssh port:22
#Protocol 2,1
/home/dingyong/.ssh (700)
/home/dingyong/.ssh/id_rsa.pub (644)
/home/dingyong/.ssh/authorized_keys (600)
The first CentOS machine(IP:114.80.x.x) connect to this machine(IP:180.178.x.x) success
----------------------------------------------------------------
<3>The third machine(FreeBSD)
IP:141.105.x.x UserName:dingyong
ssh port:1441
#Protocol 2
/home -> /usr/home
dingyong's home file is /usr/home/dingyong/
/usr//home/dingyong/.ssh (700)
/usr//home/dingyong/.ssh/id_rsa.pub (644)
/usr//home/dingyong/.ssh/authorized_keys (600)
The first CentOS machine(IP:114.80.x.x) connect to this FreeBSED achine(IP:141.105.x.x ) failure
The Command:
ssh dingyong@141.105.x.x
The Error:
ssh: connect to host 141.105.x.x port 22: Connection refused
The Command:
ssh -P 1441 dingyong@141.105.x.x
The Error:
ssh: connect to host 1441 port 22: Invalid argument
The Command:
ssh -p 1441 dingyong@141.105.x.x
The Error:
(nothing.can't connect)
----------------------------------------------------------------
So please help me to solve this problem!
Thank you very much!
ps: my English is pool...the sentence maybe is wrong.
----------------------------------------------------------------
----------------------------------------------------------------
ssh dingyong@141.105.x.x -p 1441 -vv
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 141.105.x.x [141.105.x.x] port 1441.
----------------------------------------------------------------
----------------------------------------------------------------
ping -v 141.105.x.x
PING 141.105.x.x (141.105.x.x) 56(84) bytes of data.
64 bytes from 141.105.x.x: icmp_seq=1 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=2 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=3 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=4 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=5 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=6 ttl=52 time=407 ms
64 bytes from 141.105.x.x: icmp_seq=7 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=8 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=9 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=10 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=11 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=12 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=13 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=14 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=15 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=16 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=17 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=18 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=19 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=20 ttl=52 time=407 ms
64 bytes from 141.105.x.x: icmp_seq=21 ttl=52 time=407 ms
64 bytes from 141.105.x.x: icmp_seq=22 ttl=52 time=406 ms
64 bytes from 141.105.x.x2: icmp_seq=23 ttl=52 time=405 ms
64 bytes from 141.105.x.x: icmp_seq=24 ttl=52 time=406 ms
64 bytes from 141.105.x.x: icmp_seq=25 ttl=52 time=405 ms
--- 141.105.x.x ping statistics ---
25 packets transmitted, 25 received, 0% packet loss, time 23988ms
rtt min/avg/max/mdev = 405.467/406.204/407.373/0.829 ms
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
# Note that some of FreeBSD's defaults differ from OpenBSD's, and
# FreeBSD has a few additional options.
#VersionAddendum FreeBSD-20100308
Port 1441
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# The default requires explicit activation of protocol 1
#Protocol 2
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# Change to yes to enable built-in password authentication.
#PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable PAM authentication
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#tcs
ClientAliveInterval 15
ClientAliveCountMax 6
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
----------------------------------------------------------------
---------------------------------------------------------------- ssh_config
# $OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $
# $FreeBSD: src/crypto/openssh/ssh_config,v 1.34.2.2.4.1 2010/12/21 17:09:25 kensmith Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# BatchMode no
# CheckHostIP no
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# VersionAddendum FreeBSD-20100308
Last edited by DingYong; 12-05-2012 at 06:58 AM.
Reason: There is more info
connecting? So it timed out eventually? looks like a network issue as it's not establishing a network conenction at all. can you ping it? Is it on the same subnet? Are all subnets defined correctly on all boxes? No /24's cklashing with /26's or something ugly?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.