FileZilla is one of the most popular FTP clients for Windows, Linux and MacOS. The program allows you to connect to a remote FTP server, see a list of files and directories, download files from the server and pumped back and edit files using a text editor.
But sometimes connecting to the server is having problems and you can meet the message critical error, cannot connect to FileZilla server or the connection is interrupted after 20 seconds of no activity. In this article we will look at why connection does not work and how to fix the problem.
Error could not connect to server in Filezilla
Problems connecting to the FTP server can be caused by different reasons. Here are the most frequent and main ones are:
- The port of FTP server is closed by the firewall or enter incorrect;
- Entered is not a valid username and password;
- The server does not support TLS encryption;
- You are trying to connect to sFTP server.
Consider the solution for each cause.
1. The port of FTP server is closed
In this case, you can get the ERRCONREFUSED error or connection refused by server Filezilla. If you have access to the server on which you installed FTP, make sure that the configuration file is specified the port to connect to. If you do not specify any port in the interface, the default is port 21.
Then you try to connect to this port with telnet command:
telnet reservera 21
If a team does not show error message Connection refused means the port is available and the problem is not here. Otherwise, you need to open the FTP port in the server firewall. The commands for this will depend on the shell you are using firewall. For example, firewalld in CentOS with the command will look like this:
sudo firewall-cmd --permanent --add-port=21/tcp
sudo firewall-cmd --permanent --add-port=20/tcp
sudo firewall-cmd --permanent --add-port=1024/tcp
sudo firewall-cmd --reload
And in Ubuntu:
sudo ufw allow ftp
Or universal command for iptables, if no shell is not used:
sudo iptables -A INPUT -p tcp -m tcp --dport 21-m conntrack --ctstate ESTABLISHED,NEW-j ACCEPT-m comment --comment "Allow ftp connections on port 21"
sudo iptables -A OUTPUT-p tcp -m tcp --dport 21-m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT -m comment --comment "Allow ftp connections on port 21"
sudo iptables -A INPUT -p tcp -m tcp --dport 20-m conntrack --ctstate ESTABLISHED,RELATED-j ACCEPT-m comment --comment "Allow ftp connections on port 20"
sudo iptables -A OUTPUT-p tcp -m tcp --dport 20-m conntrack --ctstate ESTABLISHED -j ACCEPT -m comment --comment "Allow ftp connections on port 20"
sudo iptables -A INPUT -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED -j ACCEPT -m comment --comment "Allow passive inbound connections"
sudo iptables -A OUTPUT-p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED,RELATED-j ACCEPT-m comment --comment "Allow passive inbound connections"
After that you will be able to connect to your FTP server.
2. Invalid username or password
Another common problem – you are using wrong username or password to connect. Then FileZilla will display an error message Incorrect login or password. You could forget the password, even if you think that you enter it correctly. Change the password for your user on the server and try to connect again.
To do this, log in to the server and change the password for that user use to connect with the command:
FTP servers take the data, authenticate users of the system, so it should work.
3. The server does not support TLS
By default, FileZilla is trying to use an encrypted connection using the algorithm of TLS encryption to your passwords, no one was able to catch. Not all servers support this type of encryption and is usually FileZilla must recognize that automatically, but doesn’t always work. The problem is solved by disabling forced encryption for the desired hosts.
Open the file menu, and then the Manager Host. In the opened window, click New hostto add a new address:
Then enter a name for the new host. Next, in the right part of the window, enter the IP address, port, username and password.
In the field Protocol is necessary to select FTP, the logon Type – Normal, and Encryption – to Use normal FTP (not secure).
After this save the settings and connect to the server.
4. You are trying to connect to sFTP server
When such a problem you can get the error message connection interrupted after 20 seconds of inactivity filezilla or filezilla failed to retrieve directory listing
. The default is FTP. If the server is only via sFTP, then you will not be able to connect to it. Re-open site Manager and add a new host:
Then in the Protocol box, select sFTP. All other parameters enter fill in similar to the previous paragraph. Now everything will work.
In this article, you learned what to do if filezilla does not connect to the server, it may be not all reasons that can cause that error, but it is with them I have encountered I had to solve them. What other causes of connection problems do you know? Write in the comments!