Cannot connect remotely using ssh

I have recently installed an ubuntu 16.04. I have installed ssh server and the sshd service is up and running.

I have some other PCs in the same network (windows, mac, ubuntu 14.06) and I can ping the ubuntu pc from all of them, but I cannot connect using ssh from any.

For example, using putty from windows I get a "Network error: Connection Timed out".

Locally I can connect using ssh with the IP.

Any idea of what could be happening?

Thank you in advance for your help!!

Gonzalo.


Instead of turning off your firewall completely, you could instead configure UFW to allow your SSH traffic: sudo ufw allow ssh or if you decide to run SSH on a different port: sudo ufw allow 2222/tcp

UFW by default will deny all incoming connections and allow all outgoing connections. You can find more information on how to configure UFW here: https://help.ubuntu.com/community/UFW


It turned to be that the firewall was enabled.

After executing 'sudo ufw disable' I was able to remotely connect.

Thank you Brian and all for your help.

Regards,

Gonzalo.


Other answers have pointed out most of the causes. I would add another reason for not able to ssh. If you ssh by password authentication method, it may be because your password is a bad one. Just update a decent password, it will work. This was driving me crazy to find out...