If you want to change the port that is used to connect to the FTP server, you will need to modify the configuration file then restart the service.
1. Use your preferred text editor, such as vi or nano to create or edit the /var/cpanel/conf/pureftpd/local file.
2. Set the port number the to the port of your choosing using the "Bind" variable. Make sure that you select a port that is not already in use by another service, and ensure that the port is not blocked by your firewall software or otherwise inaccessible. An example of this file's contents when setting "Bind" is included below:
# cat /var/cpanel/conf/pureftpd/local
3. To apply your changes, perform a force update of FTP with the following command:
# /scripts/setupftpserver pure-ftpd --force
4. Confirm the FTP service is now listening on the new port number. For example, I used port 6021:
# lsof -P -n -i :6021
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pure-ftpd 21249 root 4u IPv4 6547868 0t0 TCP *:6021 (LISTEN)
pure-ftpd 21249 root 5u IPv6 6547869 0t0 TCP *:6021 (LISTEN)
For more information visit our documentation: