I installed openssh on my new Ubuntu14.04 server, turned on ssh, and enjoyed it after I finished installation. Every thing was fine; however, after just one night, I was blocked when using putty as usual. I got the message: connection refused.

I rebooted the server, and I were again able to connect my server through ssh. But, after half a day, it happened again: my connection through ssh is refused.

I thought some important settings might be accidentally modified, so I re-installed Ubuntu 14.04 on the server. It worked at that moment but failed at the next day.

I wondered if there was anything wrong on the firewall, but the firewall manager said that another server, which is one of the new servers in our lab, under the same firewall policy does not have this problem, so there should be some problems on our machine.

There is no physical problem on internet, because the engineer showed me that he can ping this server through port 80.

This is confusing because the problem exists even though I re-installed the OS. There is no physical problem on the internet, and the firewall policy does not block other servers from my IP. Are there any ssh variables or system settings that I should check?

  • are you sure that you installed openssh-server in the ubuntu machine. and please verify that the port 22 in your pc is opened in the firewall. Jul 29, 2014 at 11:05
  • Did you see this question: How to solve 'Connection refused' errors in SSH connection? It appears that the cause of this issue is most likely an IP address conflict (that is, another machine might have the same IP address your server does). Take a look at the answers to that question to identify if there is an IP address conflict, and change the IP address of your server to see if it fixes the problem (and let us know if it does).
    – Alaa Ali
    Jul 29, 2014 at 11:25
  • To Rajesh Rajendran, I am sure that is openssh-server, because I reinstall it twice Jul 30, 2014 at 8:24
  • To Alaa Ali, I've read that, but I think the problem should not be IP conflict because our servers are using static IPs respectively Jul 30, 2014 at 8:25
  • Did the ip change? are you using the correct port? Are you connected to the same router (do you have 2)? Dec 29, 2015 at 23:48

1 Answer 1


I was simply locked fully out of my machine and getting connection refused. Purging and reinstalling openssh-server + client seems to have fixed it for me.

  • If reinstalling the entire OS didn't fix it, I don't think purging and reinstalling will. Dec 30, 2015 at 0:05
  • Indeed that's true. But I didn't have the same issue, but wanted to help others who had mine. Dec 31, 2015 at 10:43

You must log in to answer this question.

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