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.
Please Like and follow us at, LinkedIn, Facebook, Twitter, and GitHub
Also, Please comment on the post with your views and let us know if any changes need to be done.
Thanks!
How to Install WordPress on Top of LAMP Stack on Ubuntu and Redhat/CentOS7 Server.
How to Install and Setup WHM and cPanel On CentOS7 – Part 1
Basic WHM Configuration and Hosting a Website in cPanel Account – Part 2
How to Create Email and FTP Account in cPanel – Part3
How to Redirect Primary Domain to a Specific Folder in cPanel.
Issue – cPanel Email Going to Spam.
How to Migrate WordPress Website to cPanel – Part 4
How to Migrate Email Accounts from One cPanel to Another – Part 5
How to use an SSL Certificate for your cPanel Website for Free – Part 6
Redirect HTTP to HTTPS for your Website on cPanel – Part 7
How to Upgrade and Downgrade MariaDB Version in WHM/cPanel – Part 8
cPanel – phpMyAdmin asking for Username and Password. Error – Access Denied.
I was looking for this information for 2 days, I couldn’t find it even on cPanel documentation
Thank you so much for your tutorial, it is much appreciated
Thanks a lot, do check our other informative articles and share your feedback. Thanks