The Curious Website Designer

Connection Timed Out When Connecting Via PuTTY

Posted by The Curious Website Designer | Posted on Sat 8 Dec 2018

Connection Timed Out When Connecting Via PuTTY

I recently had a situation where every time I tried to connect to my server using PuTTY I kept getting a 'Connection Timed Out' error.

Here's what I did to fix it.

The first thing I tried was temporarily disabling the firewall. In my case, PuTTY was then able to make the connection and I could log in straight away.

So I restarted the firewall and started to check where the problem might be.

My first port of call was the firewall configuration file (in my case /etc/csf/csf.conf). I searched for the section on TCP Ports:

  1. # Allow incoming TCP ports
  2. TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2030,2031,2082,2083,2086,2087,2095,2096,2304,30000:50000"
  3.  
  4. # Allow outgoing TCP ports
  5. TCP_OUT = "20,21,22,25,53,80,110,113,443,2030,2031,2082,2083,2086,2087,2095,2096,587,993,995,2304,30000:50000"

 

I found that the default port that I had set up for SSH was not included so I added that in.

  1. # Allow incoming TCP ports
  2. TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2030,2031,2082,2083,2086,2087,2095,2096,2304,4567,30000:50000"
  3.  
  4. # Allow outgoing TCP ports
  5. TCP_OUT = "20,21,22,25,53,80,110,113,443,2030,2031,2082,2083,2086,2087,2095,2096,587,993,995,2304,4567,30000:50000"

I then saved the file and restarted the firewall.

Problem solved !

Tags: putty, troubleshooting, connection, connection problems, timeout, time out, timed out