Plain FTP on a per-account basis is rarely turned off when an account is migrated to SFTP — the account works, no one notices the open door. Six months later a credential leaks and the access log shows a successful FTP login from an IP nobody recognizes. Disable FTP on accounts that don’t need it; the work is small.
What’s happening
Pure-FTPD on cPanel authenticates against the cPanel user database and against per-account sub-FTP accounts stored in /etc/proftpd/<user> (despite the name, this is pure-ftpd data on most cPanel installs). Disabling FTP for an account means removing the main account’s ability to log in by FTP and removing all sub-FTP entries, while leaving the cPanel user, mail accounts, and SFTP path alone.
How to verify
Identify what is currently allowed:
cat /etc/proftpd/<user>
whmapi1 list_ftpsessions
last -i | grep -i ftp
grep <user> /var/log/xferlog | tail
The first command shows the sub-FTP account database for the cPanel user. xferlog tells you whether anyone has actually used FTP recently — if it has been silent for 90 days, there is no production load to migrate.
The fix
- Remove sub-FTP accounts via WHM > Manage FTP or
whmapi1 deleteftpper entry. Keep a copy of the list — you may need to recreate them as SFTP users. - Disable the main account’s FTP password by setting an impossible password in
/etc/proftpd/<user>— the supported approach is via cPanel API:uapi --user=<user> Ftp passwd password=$(openssl rand -base64 32). Don’t share the new password. - Communicate the switch — clients who were FTP-uploading site assets need SFTP credentials and an updated client config. Send a one-pager with FileZilla/Cyberduck SFTP setup steps.
- At the server level, narrow
PassiveIPandPassivePortRangein/etc/pure-ftpd.conf, and consider raising the FTP listening port from 21 to 2121 if no one legitimately needs port 21 — the bots scan 21, not 2121. - Audit quarterly:
whmapi1 list_userscross-referenced with sub-FTP databases. New accounts created later may re-introduce FTP — catch that drift early.
Stack Harbor includes FTP lockdown audits in every cPanel/WHM management engagement.