LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-05-2012, 05:31 AM   #1
DingYong
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
Linux ssh con't connect to FreeBSD


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

----------------------------------------------------------------
----------------------------------------------------------------
sshd_config
# $OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
# $FreeBSD: src/crypto/openssh/sshd_config,v 1.49.2.2.4.1 2010/12/21 17:09:25 kensmith Exp $

# 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

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# 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
 
Old 12-05-2012, 05:36 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please run

ssh dingyong@141.105.x.x -p 1441 -vv
 
Old 12-05-2012, 05:43 AM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
ssh -p 1441 dingyong@141.105.x.x
The Error:
(nothing.can't connect)
ssh -v -p 1441 dingyong@141.105.x.x

How long does it take to "do nothing"?

Is there any firewall or hosts.deny style restriction on connecting to the FreeBSD SSH service?
Are all versions involved OpenSSH?
 
Old 12-05-2012, 05:45 AM   #4
DingYong
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
please run

ssh dingyong@141.105.x.x -p 1441 -vv
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.
 
Old 12-05-2012, 06:07 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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?
 
Old 12-05-2012, 06:21 AM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by acid_kewpie View Post
network issue as it's not establishing a network conenction at all. can you ping it? Is it on the same subnet
He's reported "connection refused" on port 22 and stated half IP addresses that differ.
 
Old 12-05-2012, 06:45 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by linosaurusroot View Post
He's reported "connection refused" on port 22 and stated half IP addresses that differ.
yes, but the port 22 issue was a misuse of the ssh command, it's supposedly listening on 1441
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Con't connect to PPTPD server, same configuration I've used before vockleya Linux - Server 1 07-24-2011 04:25 PM
any way to connect my Freebsd box and my linux laptop user1442 *BSD 7 11-07-2005 09:07 PM
Con't connect to internet--Very frustrating Pedal2Metal Linux - Newbie 8 10-25-2004 12:52 AM
SSH dies with ssh_exchange_identification: Con... Snabber Linux - Networking 5 07-08-2003 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration