ssh: connect to host HOSTNAME port 22: Connection timed out

To properly test your ssh use ssh user@ipaddress. If that fails, the issue is something deeper like the connection.


Allow ssh to ufw will solve the problem. Run the below command to allow.

sudo ufw allow ssh

To properly test your ssh use ssh user@ipaddress. If that fails, the issue is something like the firewall.

For example, checkout firewall status with below code

sudo ufw status

If it is working then first deactivate firewall with below code:

sudo ufw disable

and test ssh user@ipaddress