Applicable to:
- Plesk for Linux
Symptoms
-
FTP directory listing is not working for the dedicated IP on a Linux Plesk server that is behind NAT. The error that is displayed is similar to the following:
CONFIG_TEXT: ftp> ls
421 Service not available, remote server has closed connection
Passive mode refused.
Cause
ProFTPd's MasqueradeAddress feature is configured on a Plesk server that uses more than one IPv4 address.
MasqueradeAddress instructs the FTP server to provide only the defined IP within the configuration to FTP clients, due to which they attempt to establish a connection only to that specified IP address:
# grep -r Masq /etc/proftpd*
MasqueradeAddress 203.0.113.2
If your server has several IP addresses, this static setting forces all passive connections to use that IP, which is causing the issue.
Resolution
In order to resolve such an issue, it is necessary that you turn off the MasqueradeAddress of ProFTP for the IP address that is affected, which can be done by following these steps:
- Connect to the server via SSH
-
Create a
/etc/proftpd.d/49-masquerade-off.confconfiguration file:# touch /etc/proftpd.d/49-masquerade-off.conf
-
Edit
/etc/proftpd.d/49-masquerade-off.confwith your favorite command-line text editor and add the following content:Note: Replace 203.0.113.2 with the server IP address for which it is required to disable the MasqueradeAddress setting.
CONFIG_TEXT: <VirtualHost 203.0.113.2>
MasqueradeAddress none
</VirtualHost> - Save the changes and close the file
-
Restart
proftpdby executing the following command:# systemctl restart proftpd
Comments
Please sign in to leave a comment.