Skip to content

Configuring FTPS explicit TLS correctly on cPanel

How to configure FTPS with explicit TLS (AUTH TLS) on cPanel Pure-FTPd so the data channel and control channel both negotiate cleanly, and so passive ports work behind a firewall.

FTPS explicit on port 21 (AUTH TLS) is the protocol you fall back to when SFTP isn’t an option. Configured correctly, it is acceptable. Configured the default way, it negotiates inconsistently, fails behind NAT, and leaves passive port ranges so wide that the firewall config is barely a firewall.

What’s happening

FTPS explicit starts as a plain FTP connection on port 21, then the client issues AUTH TLS and both sides upgrade to TLS. After login, the client requests passive mode (PASV) and the server returns a port number in a configurable range; the client opens that port for the data channel. Passive ports are encrypted same as the control channel — assuming TLS is required for data, not just control.

The classic misconfiguration: TLS required on control, optional on data. Credentials are protected; file contents pass in cleartext. Equally classic: a wide passive port range (e.g. 30000-65535) opened in the firewall, defeating the purpose of having one.

How to verify

grep -E 'TLS|Passive' /etc/pure-ftpd.conf | grep -v '^#'
testssl.sh --starttls ftp <host>:21
nmap -p 21 --script ftp-anon <host>
lftp -e "set ssl:verify-certificate yes; ls" ftps://<user>@<host>

testssl.sh reports the cipher list and TLS versions actually offered. lftp testing reveals whether passive mode lands in your firewall hole.

The fix

  1. In /etc/pure-ftpd.conf set TLS 2 (require TLS for both control and data, refuse cleartext fallback). Restart pure-ftpd.
  2. Set PassivePortRange 40000 40100 — a narrow range. 100 ports is enough for hundreds of simultaneous FTPS sessions.
  3. Open exactly that range in the firewall: firewall-cmd --add-port=40000-40100/tcp --permanent && firewall-cmd --reload. Wider opens are not security; they are theater.
  4. Confirm certificate validity. Pure-FTPd reads /etc/ssl/private/pure-ftpd.pem by default. Use the cPanel certificate or a Let’s Encrypt cert — never a self-signed one for production.
  5. Test from an external host before declaring done. Internal tests bypass the firewall path and can pass when external clients fail.

Stack Harbor hardens FTPS configurations as part of cPanel/WHM management.