Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    ssh doesn't connect - ping works

    Want to transfer files from a Fedora Core 5 desktop (address and the user-name: jb) to a Suse 10.2 laptop (, jim). Connect with a crossover cable. Same broadcast:

    Ping works from the laptop but ssh cannot connect:
    # ping
    PING ( 56(84) bytes of data.
    64 bytes from icmp_seq=1 ttl=64 time=0.163 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.180 ms
    64 bytes from icmp_seq=3 ttl=64 time=0.179 ms
    --- ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 0.163/0.174/0.180/0.007 ms
    # ssh jb@
    ssh: connect to host port 22: No route to host
    # /sbin/route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 0 eth0 U 0 0 0 lo

    From the desktop can also ping, but cannot connect, a different error message:
    #ssh: connect to host port 22: Connection timed out
    # /sbin/route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 0 eth0 U 0 0 0 eth0 UG 0 0 0 eth0

    Question: if can ping between the 2 computers, what is the easiest way to transfer files?
    Diagnostics, shows port 22 is open:

    On laptop:
    # nmap -T5 -sV localhost
    Starting Nmap 4.11 ( ) at 2006-12-17 13:02 MST
    Interesting ports on localhost (
    Not shown: 1675 closed ports
    22/tcp open ssh OpenSSH 4.4 (protocol 1.99)
    25/tcp open smtp Postfix smtpd
    111/tcp open rpc
    631/tcp open ipp CUPS 1.2
    6000/tcp open X11 (access denied)
    Service Info: Host:; OS: Unix
    Nmap finished: 1 IP address (1 host up) scanned in 6.270 seconds
    # ps aux | grep sshd
    root 3619 0.0 0.1 53460 1528 ? Ss Dec16 0:00 /usr/sbin/sshd -o PidFile=/var/run/
    root 9721 0.0 0.0 5008 796 pts/0 S+ 13:10 0:00 grep sshd

    On the desktop, nmap shows port 22 is also open:
    22/tcp open ssh OpenSSH 4.4 (protocol 2.0)
    # ps aux | grep sshd
    root 2255 0.0 0.1 4976 1108 ? Ss 02:04 0:00 /usr/sbin/sshd
    root 25016 0.0 0.0 3916 656 pts/0 R+ 13:11 0:00 grep sshd

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Just to be sure I'm with you on this, you're running sshd daemons on both the laptop and desktop, and you also want both to work as clients? (You might settle for one server, one client.)

    First, from laptop to desktop problem:
    ssh: connect to host port 22: No route to host
    From your routing table it looks like you need to add a default gateway. (Maybe you can use the same default gateway your desktop is using? I've never done with this a crossover cable.)

    Second, from desktop to laptop problem:
    #ssh: connect to host port 22: Connection timed out
    Sounds like you might have forgotten to poke a hole in the laptop firewall for port 22?

    Some other tips:
    • The ps aux | grep sshd command you used is a good way to confirm the daemon is running.
    • Using netstat -atn | grep 22 you can determine whether sshd is listening on tcp port 22 for connections.
    • Running nmap against the loopback device (localhost) is virtually useless. It would be better to run it against the external interface - you can do that from one machine to the other to test if the port is really open to you.

  3. #3

    firewall was blocking

    Thanks anomie. One thing about that Suse firewall: it does indeed work ! Yast - security and users - and clicked to disable firewall.
    Using fish in the konqueror location bar also helps tremendously, allowing file transfers by dragging/ dropping icons, as if on one machine.
    fish://jim@ and then it asks for password, connects.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts