When attempting to connect to an FTP server, the client fails with an error similar to the following:
227 Entering Passive Mode
Error: Connection Timeout
Description
This can occur when the Passive IP address is incorrectly set, we can verify the IP that is currently set in our FTP server configuration files using the steps below:
ProFTP
The configuration file is located at /etc/proftpd.conf
grep 'MasqueradeAddress' /etc/proftpd.conf
MasqueradeAddress 1.1.1.1
Pure-FTP
The configuration file is located at /etc/pure-ftpd.conf
grep 'ForcePassiveIP' /etc/pure-ftpd.conf
ForcePassiveIP 1.1.1.1
Workaround
PureFTP
Log into your server via SSH.
Determine your public IP address.
root@server [~] # curl myip.cpanel.net
184.94.197.2
Open the "local" configuration file to ensure changes aren't overwritten by cPanel. In this file, add the server's public IP address if it is in a NAT environment.
nano /var/cpanel/conf/pureftpd/local
ForcePassiveIP: 184.94.197.2
If the server is not in a NAT environment, this should be instead set to the following:
ForcePassiveIP: ~
To publish our changes:
/scripts/setupftpserver pure-ftpd && /scripts/restartsrv_ftpd
Important: Only one ForcePassiveIP entry can exist in a configuration file.
ProFTP
Log into your server via SSH.
Determine your public IP address.
root@server [~] # curl myip.cpanel.net
184.94.197.2
Open the "local" configuration file to ensure changes aren't overwritten by cPanel. In this file, add the server's public IP address if it is in a NAT environment.
nano /var/cpanel/conf/proftpd/local
MasqueradeAddress: 184.94.197.2
If the server is not in a NAT environment, this should be instead set to the following:
MasqueradeAddress: ~
To publish the changes:
/scripts/setupftpserver proftpd && /scripts/restartsrv_ftpd
Important: Only one ForcePassiveIP entry can exist in a configuration file.
Resources
More details on configuring passive mode can be found in cPanel Documentation: How to Enable FTP Passive Mode
If you continue to have issues even after adjusting these settings, please review the article Passive FTP Issues
Comments
0 comments
Article is closed for comments.