Sometimes, Server Administrators encounter issues like "PuTTY Fatal Error: Connection timed out" while trying to establish connections to their server via Putty SSH tool.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix SSH Linux Server related issues.
In this context, we shall look into how to resolve this error.
What triggers "PuTTY Fatal Error: Connection timed out"?
Recently, we encountered an error when trying to use Putty to connect to our Server. The error message look like this;
PuTTY Fatal Error Network error: Connection timed out
We noted that the main causes of this error are;
i. The IP address of the host and virtual machine does not belong to the same subnet.
ii. When on a network which blocks traffic to port 22.
iii. The ssh service on our droplet / Server is not running.
For example, when this error occurs, it is recommended to check the IP address of host and the virtual machine to ensure that they belong to the same subnet.
To find the IP of the Linux virtual machine, you can use the ipconfig command below:
#Check Host IP
We discovered that the range of IP of the host computer is 192.168.205.1 & subnet mask is 255.255.255.0,. Then, we checked the IP of the Linux virtual machine which is generally given during the installation.
To do this, execute the ifconfig command on Linux machine as shown below;
#Check Red Hat Linux Server IP
Here, we saw that the IP is 192.168.0.1 which is of a different IP range. That is the major cause for the error, "Network error: Connection timed out"
To correct this, you need to make both the Linux and host machine IP under the IP the host runs.
How to fix "PuTTY Fatal Error: Connection timed out"?
To fix this issue, you can simply change the IP of Linux machine to the same range on which local host is running.
To implement this, start by connecting to your Linux machine and then configure the new IP for the connection interface name.
To make this happen, run the following command;
#Change the IP of connection interface name ens33 to 192.168.205.10. sudo ifconfig ens33 192.168.205.10 netmask 2522.214.171.124
After running the above command successfully, then execute the ifconfig command to see if the IP has changed to 192.168.205.10.
Now proceed with the connection to the machine from host computer by following the steps below;
i. Launch the PuTTY tool
ii. Enter the IP of the Linux virtual machine
iii. Click on "open button".
When directed to another window where we clicked on the "Yes" to proceed.
This will display a login window where you can enter a login id and password to connect to Linux virtual machine.
Now the connection to the Linux virtual machine from host computer will be successful.
Next we do the following;
i. Try to establish connection from another network or device to quickly test this.
ii. Connect through the console and confirm the status of SSH service.
You will see that the issue is solved and now we can perform Linux tasks on the Linux virtual machine from the host computer using PuTTY terminal.