SSH CONNECT TO HOST PORT 22 NETWORK IS UNREACHABLE LINUX HOW TO
Then use the firewall-cmd ( RHEL/CentOS/Fedora) or UFW ( Debian/Ubuntu) to open port 22 (or the port you configured to be used for SSH) in the firewall as follows. I want to connect them using ssh.that is, I want to share files using ssh or samba and I dont know anything about networks. Therefore you need to access the server console physically or if it is a VPS, you can use any other means such as VNC (that’s if it is already setup) or other custom remote server access applications provided by your VPS service provider. If you have a firewall service running on your remote server, it is possible that the firewall is blocking access via port 22. In this case, the reason for the error is something else. # ping 192.168.56.100įrom the ping command results, the server is up and running, that’s why it is accepting the pings. ssh: connect to host localmachine port 22: Network is unreachable Error 37 GitHub Error - 'ssh: connect to host port 22: Operation timed out fatal: Could not read from remote repository. The first is normally that the remote server could be down, so you need to check whether it is up and running using the ping command. There are different reasons why this error appears. As a security measure, system administrators can configure SSH to be accessed via a different port. If you use SSH on a custom port other than port 22, entering the allow ssh command will not work, and UFW will continue blocking connections. This command will tell the UFW firewall to allow the ssh profile through the firewall, which is, by default, port 22. Note that the port may not necessarily be port 22, depending on your configurations on the remote host. In the terminal, execute the sudo ufw allow ssh command. Here is a screenshot of the error we are talking about. The reason could be the firewall modification as you are under a network. In this short article, we will show how to troubleshoot and fix this error.
And one of the common errors encountered while using SSH is the “ ssh: connect to host port 22: No route to host”. SSH is the most secure means of connecting to Linux servers remotely.