Articles in this section

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

Plesk for Windows Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

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

CONFIG_TEXT: Connection timed out


CONFIG_TEXT: Connection refused


CONFIG_TEXT: 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.


    FTP_rules__2_.PNG

 

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

  • A third-party firewall, in case it is used, is not blocking the connection to the FTP ports.
  • An intermediary firewall between a Plesk server and the Internet is not filtering the FTP ports. Contact your Internet Service Provider (ISP) for assistance.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.