Putty SSH connection refused

On my server (Ubuntu 14.04 LTS) I rebooted the other day and since then I've had a "Putty Fatal Error: Network Error: Connection Refused". The webserver is working, but I can't connect to log into it.

I don't really want to rebuild the server, but I can if I need to. Fairly new to this, so any tips or pointers are very appreciated.

2 Replies

You can use Lish to access your server if ssh isn't working.

It's probably one of two things. First, check whether sshd is running:

`$ ps auwwwwx | grep [s]shd
root      3185  0.0  0.1  61372  1788 ?        Ss   Sep27   0:04 /usr/sbin/sshd -D`

If you don't get a line with /usr/sbin/sshd, then it is not running.  Check your configuration file /etc/init/ssh.conf to make sure it's set to start.  You should have this in that file:
`~~[code]~~start on runlevel [2345]
stop on runlevel [!2345]<e>[/code]</e>`

Then as root or using sudo, run **~~[b]~~initctl start ssh<e>[/b]</e>** to start the ssh daemon.  If /etc/init/ssh.conf is set up properly as noted above, then ssh should automatically start when your server is rebooted.

If you find that sshd is running, the other possibility is that your firewall is not allowing traffic to port 22\.  If you are using ufw, then running **~~[b]~~ufw allow 22<e>[/b]</e>** as root should open this port.  Otherwise, let us know what you are using to manage your firewall.[/s]

Thanks for your input. I ended up rebuilding the server, so problem solved now. :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct