Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have access to a Ubuntu Server (10.4) that I can't SSH into. From a terminal the connection times out and from putty the connection is refused.

I have checked that sshd is running and listening on all interfaces, iptables has all chains empty and default is ACCEPT, additional firewall is accepting on port 22 inbound, and all outbound. I can't telnet into port 22 either.

What could the problem be and how can I troubleshoot it?

share|improve this question
So the SSHD runs, listens to port 22, the firewall allows SSHD to be accessed from remotely. How about your client system and you own network; does that allow you to go out ? have you tried the logging options in putty ? have you been in that server before from where you want to access it at the moment ? – Richard Jun 7 '12 at 4:04
I can ssh from my current network, just not into this server. Putty log just tells me that the connection is refused. I've never been able to ssh into this server from anywhere. – Charissa Jun 7 '12 at 4:44

Try logging in to the console then:

ssh localhost

That will test the ssh daemon on the host without regard to the firewall or other filtering.

share|improve this answer
When I run that I get "Host key verification failed." I'm fairly sure that I have SSH set up for password authentication though. – Charissa Jun 7 '12 at 6:28
ssh-keygen -R localhost, then try again – dmourati Jun 7 '12 at 8:19

Are you running the server or is someone else? Do you have root access on the server? It sounds like you may be blocked on the server end. Not much you can do from the client side. First thing is to try using the '-v', '-vv', or '-vvv' options to get some debug info about what's going on:

ssh -vv

If that's unhelpful you can do a traceroute, ping, nmap on the host to try and see if you can see the machine on the network:

nmap -v -A

It's likely you're being blocked by the firewall on and not fixable on the client side.

Do you have access to server? If so, you can eliminate the firewall as a potential problem on the server by disabling it, trying to ssh, and then re-enabling it (all from the server):

sudo servce iptables stop; ssh -v localhost; sudo service iptables start

Are you sure the sshd process is running? Try looking to see if it's running:

sudo service sshd status

If it's not running you need to start it:

sudo service sshd start

You can enable it permanently with:

sudo chkconfig sshd on
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.