Skip to content

A note about FTP Connection Issues

Heisenbug edited this page Mar 5, 2026 · 1 revision

Home · Start Here · Reference Map

At a glance

  • FTP behind stateful firewalls works best in passive (PASV) mode.
  • If FTP conntrack helpers are unavailable, you must define an explicit passive port range.
  • FTP over TLS can break helper-based tracking, so passive range design becomes critical.

Related guide: Troubleshooting-and-Recovery

Why FTP is special

FTP uses separate control and data channels. Stateful firewalls typically rely on conntrack helpers to understand and permit related data flows.

On some kernels/environments (especially certain VPS/monolithic setups), FTP helper modules may be missing or restricted, which can break passive transfers unless you open an explicit passive range.

Recommended baseline

  1. Configure FTP clients to use PASV mode.
  2. Define a dedicated passive range in your FTP daemon.
  3. Open the same range in CSF (TCP_IN).
  4. Reload CSF and restart FTP service.

Example: pure-ftpd

Set matching passive ports in daemon config:

# /etc/pure-ftpd.conf
PassivePortRange 30000 35000

Allow same range in CSF:

TCP_IN = "...,30000:35000,..."

Apply changes:

csf -ra
systemctl restart pure-ftpd 2>/dev/null || service pure-ftpd restart

Example: proftpd

Set passive ports:

# /etc/proftpd.conf
PassivePorts 30000 35000

Allow same range in CSF and reload:

csf -ra
systemctl restart proftpd 2>/dev/null || service proftpd restart

FTP over SSL/TLS caveat

With FTPS (encrypted control channel), helper-based relation tracking may not be able to inspect control instructions that negotiate data ports.

Result: data channel setup can fail unless you explicitly open and align passive ranges in both CSF and FTP daemon config.

Validation checklist

  • Test directory listing and file transfer from an external FTP client in PASV mode.
  • Confirm passive ports are reachable and mapped correctly.
  • Review FTP daemon logs and /var/log/lfd.log for blocked flow clues.

Common pitfalls

  • Mismatched ranges between CSF and daemon config.
  • Passive range too broad without need.
  • Assuming helper modules exist on all kernels/providers.
  • Enabling FTPS without passive-range planning.

Last reviewed: 2026-02-25


← Previous: Installation on a Generic Linux Server · Next: Messenger Service

Clone this wiki locally