0

I'm trying to ssh into a server and get the following error ssh: connect to host server.mylan.lan port 22: No route to host

The strange thing is it was working and then suddenly no more, is this common, the server is running Centos 5.2

1
  • If it was working before and not anymore then have you installed anything recently that may affect connectivity - a firewall for instance. Sep 23, 2009 at 9:12

6 Answers 6

2

on the server check:

service sshd status
iptables -L 

if port 22 is open and the service is running, you have a network issue

2

I concur with sybreon and lg. This is a network issue not an ssh issue. 'No route to host' indicates that the client machine cannot make an intial network connection to the server.

Either 'server.mylan.lan' no longer resolves to your server's IP address or a critical part of infrastructure is down making your subnet unavailable, or the server is switched off maybe??

1

DNS problem? Can you ping server.mylan.lan? Try to ssh into server by ip address.

1

This is not an SSH problem but a networking one. You may want to check your networking settings particularly your gateway. Try pinging server.mylan.lan to see if you can even ping the machine.

Chances are you won't be able to. Then check your route

# route -n
# traceroute server.mylan.lan

And see what happens. Something probably changed in the networking between you and the server. Maybe a new router was installed or maybe the firewall rules changed in between.

0

No route to host?

at prompt do:

me@myMachine:~$ ping yourMachine

0

If you are on the same subnet of the server you're trying to ssh to, then it's probably a DNS or IPtables related issue.

"No route to host" means you cannot get the server address at all, not just the ssh service.

Try checking iptables rules on the server (if you can plug a monitor and a keyboard into it of course).

Check the output of

# dig server.mylan.lan

Try pinging its hostname and/or its ip address.

If your server is on a different network, check all the above AND the routing tables.

# traceroute server.mylan.lan 

could be useful as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .