If you have hosted your cPanel Account on AWS ec2 Instance or any of the other Cloud provider or Even at your Datacentre and are not able to Connect to FTP Server using any of the FTP Client with an error “cPanel FTP Failed to retrieve Directory Listing Error” then this may happen because of the Passive Port is not Open in Security group/Firewall. Passive Port range is 49152-65534
When you install cPanel in AWS ec2 instance, It by default add Passive Port in the Configuration files, Just to Verify follow the below Steps
# cat /etc/pure-ftpd.conf | grep -i PassivePort
If PassivePortRange is Commented (#) in the Configuration then go ahead and uncomment It. Restart the ftp Server Service.
# sudo su - # /scripts/restartsrv_ftpserver
Also make sure that these changes are added in /var/cpanel/conf/pureftpd/main. if not then add it.
# echo “PassivePortRange: 49152 65534” >> /var/cpanel/conf/pureftpd/main # /usr/local/cpanel/scripts/setupftpserver pure-ftpd –force
Above settings are by default enable when you Install cPanel on AWS ec2 Instances. If by chance not then follow the above Steps to enable It.
Note: Also Make Sure you open passivePortRange in the AWS Security group and NACL.
Try Connecting again and you will be able to connect to the FTP Account.
If you Like Our Content here at Devopsage, then please support us by sharing this post.
Also, Please comment on the post with your views and let us know if any changes need to be done.