Can't connect via SSH

  • Posted December 18, 2013

I trying connect to my droplet, but putty say “Network error: Connection refused”. I can connect to droplet only using Console Access. SFTP not working too.


i had the same problem but if you are runing UFW you have just to stop it or allow ssh access. you just have to login in your droplet and use ssh access to desable the firewale or to allow _ssh acess.

This comment has been deleted

This comment has been deleted

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Did you edit <code>/etc/ssh/sshd_config</code>?

Try running these commands and then start ssh (<code>service ssh start</code>): <br><pre>rm /etc/ssh/ssh_host_* <br>/usr/sbin/dpkg-reconfigure openssh-server</pre>

This comment has been deleted

vi /etc/ssh/sshd_config

PermitRootLogin yes
PasswordAuthentication yes
AllowUsers user_a user_b user_c
systemctl reload sshd

Add server ip address to /etc/hosts

Is there a firewall running? What’s the output of <pre>sudo iptables -L -n -v</pre>?

I did not open this directory never. I connect only as root

So you have <b>not</b> edited anything in <code>/etc/ssh/sshd_config</code>? What do you have listed in the <code>AllowUsers</code> directive? Is the username listed, that you’re attempting to log in with?

Hmm. I believe openssh logs to syslog, check if there are any errors: <br><pre>sudo tail -30 /var/log/syslog <br>sudo tail -30 /var/log/auth.log</pre>