FTP hangs at MLSD fix on WHM/Cpanel server

by Ruchira on May 7, 2013



Did you ever had the above shown error on your WHM/Cpanel server?  When using passive FTP timeouts at MLSD command is a common error when using FTP servers. This is because servers firewall is not willing to accept the connections on common FTP ports.

We know that port 21 is used to FTP. That port might be open on your firewall but FTP client requires other ports to be opened during the file transfers. Just like web browsers open random ports for web sites. This port range is usually called “Passive Range”. Opening this port range on your WHM/Cpanel server will fix this problem.

Log on to terminal and issue following commands


modprobe ip_conntrack_ftp

This command will load up the ip_conntrack_ftp module on your firewall.


iptables -A INPUT -p tcp -m tcp -m state --dport 30000:60000 --sport 1024:65535 --state ESTABLISHED,RELATED -j ACCEPT

This command will make the 30000 to 60000 port range available and open for your FTP server.

Then just restart FTP server from WHM and problem solved 🙂


I'm Ruchira Sahan and all posts on this blog are completely my thoughts and writings. I love DIY and Technology. So feel free to contact me for anything about this blog and don't forget to add a comment if this blog helped you! Thanks
View all posts by Ruchira

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: