LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   cant ssh into laptop (https://www.linuxquestions.org/questions/linux-networking-3/cant-ssh-into-laptop-748247/)

schneidz 08-17-2009 04:24 PM

cant ssh into laptop
 
hi, my laptop is running fedora-9 live-usb and my desktop is running knoppix-5 live-cd.

they are both ethernet attached to a netgear wgr614v8.
the knoppix machine has ip address 192.168.5.25 and the fedora machine has address 192.168.5.2. i dont see anything obviousely wrong in the router configuration.
Code:

knoppix@1[~]$ ping -c 1 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=64 time=0.646 ms

--- 192.168.5.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.646/0.646/0.646/0.000 ms
knoppix@1[~]$ ping -c 1 192.168.5.2
PING 192.168.5.2 (192.168.5.2) 56(84) bytes of data.
64 bytes from 192.168.5.2: icmp_seq=1 ttl=64 time=6.10 ms

--- 192.168.5.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.105/6.105/6.105/0.000 ms

knoppix@1[~]$ ping -c 1 192.168.5.3
PING 192.168.5.3 (192.168.5.3) 56(84) bytes of data.
From 192.168.5.25 icmp_seq=1 Destination Host Unreachable

--- 192.168.5.3 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

knoppix@1[~]$ ping -c 1 192.168.5.4
PING 192.168.5.4 (192.168.5.4) 56(84) bytes of data.
From 192.168.5.25 icmp_seq=1 Destination Host Unreachable

--- 192.168.5.4 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

knoppix@1[~]$ ping -c 1 192.168.5.25
PING 192.168.5.25 (192.168.5.25) 56(84) bytes of data.
64 bytes from 192.168.5.25: icmp_seq=1 ttl=64 time=0.048 ms

--- 192.168.5.25 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.048/0.048/0.048/0.000 ms

knoppix@1[~]$ ssh 192.168.5.1
ssh: connect to host 192.168.5.1 port 22: Connection refused
knoppix@1[~]$ ssh 192.168.5.2
ssh: connect to host 192.168.5.2 port 22: No route to host

knoppix@1[~]$ ssh 192.168.5.3
ssh: connect to host 192.168.5.3 port 22: No route to host
knoppix@1[~]$ ssh 192.168.5.4
ssh: connect to host 192.168.5.4 port 22: No route to host
knoppix@1[~]$ ssh 192.168.5.25
ssh: connect to host 192.168.5.25 port 22: Connection refused

why is it saying 'no route to host' when the host is on and connected (it takes a few seconds to come back with that error but with 192.168.5.3 and 192.168.5.4 it comes back instantaneously). it should at least try to connect and if the server isnt on should say 'connection refused' (like 192.168.5.25).

anomie 08-17-2009 06:46 PM

Quote:

Originally Posted by schneidz
it should at least try to connect and if the server isnt on should say 'connection refused' (like 192.168.5.25).

Not really. IIRC, the ssh client will report "connection refused" if a tcp RST packet is sent back. If the host is powered off (or does not exist), it's not going to be sending back any response on its own.

schneidz 08-17-2009 07:19 PM

well according to the ping above the fedora host 192.168.5.2 does exist and is powered on but ssh returns 'no route to host'
the hosts 192.168.5.3 and 192.168.5.4 do not exist and appropriately return 'no route to host'.

also the router 192.168.5.1 and the knoppix host 192.168.5.25 return the expected error
'connection refused' because their ssh servers are not on.

on the flip side this is what i get when trying to ssh from the fedora machine to the knoppix machine
Code:

[fedora@localhost ~]$ ssh 192.168.5.1
ssh: connect to host 192.168.5.1 port 22: Connection refused
[fedora@localhost ~]$ ssh 192.168.5.2
ssh: connect to host 192.168.5.2 port 22: Connection refused
[fedora@localhost ~]$
[fedora@localhost ~]$ ssh 192.168.5.3
ssh: connect to host 192.168.5.3 port 22: No route to host
[fedora@localhost ~]$ ssh 192.168.5.4
ssh: connect to host 192.168.5.4 port 22: No route to host
[fedora@localhost ~]$ ssh 192.168.5.25
ssh: connect to host 192.168.5.25 port 22: Connection refused


scottro11 08-17-2009 08:01 PM

Probably either firewall or selinux issue.

I think the gui tool is called system-config-firewall and there, you should be able to allow ssh connections. (That is, on the Fedora machine, run the command, as root or with root privilege, system-config-firewall.

I think it blocks ssh by default.

schneidz 08-17-2009 08:36 PM

^ that did it. this was hard to debug because not much info could be obtained from sshd -d -d -d or ssh -v -v -v.

also nothing checked in on /var/log/messages .

anomie 08-17-2009 10:42 PM

That makes sense if your iptables INPUT chain terminated with REJECT --reject-with icmp-host-unreachable or similar... Silly me.


All times are GMT -5. The time now is 07:26 AM.