Fix VSFTPD Slow Directory Listings & Timeouts
I’ve always had trouble with vsftpd and slow directory listings or timeouts, so I’ve generally avoided it. With a little dedicated digging I finally managed to unearth how to get this working properly on a CentOS box.
All commands here are issued as root (use sudo -i to get a root shell if you don’t have access to the root account).
First of course you need to ensure that it’s installed and set to run at start up:
- yum install vsftpd
- chkconfig vsftpd on
If you’re running a firewall that it is configured to allow FTP traffic through. My CentOS uses iptables:
- service iptables stop
- iptables -A INPUT -p tcp -m tcp –dport 21 -j ACCEPT
- Open /etc/sysconfig/iptables-config in your favourite text editor.
- Either add IPTABLES_MODULES="ip_conntrack_ftp" to the top or insert ip_conntrack_ftp into the existing IPTABLES_MODULES entry. In the latter case, remember that module names are separated by a space: (eg) IPTABLES_MODULES="ip_conntrack_netbios_ns ip_conntrack_ftp"
- service iptables restart
This solved my problems – hopefully it will do the same for you!