Plesk

Unable to connect to a Plesk server via FTP when FTP ports are filtered by a firewall: Connection timed out

Symptoms

One of the following error messages appears, when connecting to a server via FTP in active mode:

Connection timed out


Connection refused


Connection attempt failed with "ETIMEDOUT - Connection attempt timed out".

Cause

TCP ports 21 and/or 20 is/are filtered.

Resolution

Enable Plesk Firewall to open these ports locally on the server.

 

Opening ports via Plesk Firewall

 

Enable Plesk Firewall to open these ports locally on the server.

 

Opening ports via a command-line interface on a Linux server

 

  1. Connect to the Plesk server via SSH.

  2. Install the optional package for managing iptables:

    • for CentOS/RHEL-based distributions:

      # yum install -y iptables-services
      # systemctl enable iptables-services

    • for Debian/Ubuntu-based distributions:

      # apt install -y iptables-persistent

  3. Allow incoming connections to the ports 20 and 21:

    • for CentOS/RHEL-based distributions:

      # iptables -I INPUT 1 -p tcp --dport=20 -j ACCEPT
      # iptables -I INPUT 1 -p tcp --dport=21 -j ACCEPT
      # service iptables save

    • for Debian/Ubuntu-based distributions:

      # iptables -I INPUT 1 -p tcp --dport=20 -j ACCEPT
      # iptables -I INPUT 1 -p tcp --dport=21 -j ACCEPT
      # iptables-save > /etc/iptables/rules.v4

 

Opening ports in Windows Firewall on a Plesk for Windows server

 

  1. Connect to a Plesk server via RDP.

  2. Open Windows Firewall in Control Panel.

  3. In Windows Firewall, click Advanced settings > Inbound Rules.

  4. Make sure the following FTP rules are enabled.

 

If after opening the FTP ports in a server firewall these ports are still blocked, make sure that: