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.
65 Answers
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:
2It 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...
Try port forwarding port 22 if you are trying to connect with a public IP address, because that would be the only reason why you can only connect to it using the local ip address of the server. Also yes if you are using the ufw firewall and it is enabled make sure you have 'ufw allow 22' executed. You can check this by running 'ufw status'.
I ran into the same issue, when I installed ubuntu 18.4. I tried all the above options and it still did not work until I ran the commands below:
1.Checked the ssh status:
sudo service ssh status
OUTPUT: Failed to restart ssh.service: Unit ssh.service not found.2.Then installed ssh:
sudo apt-get install ssh 1