Port 21: FTP

The FTP control connection for logins and commands. A constant target of password guessing, and unencrypted. Replace with SFTP, or use FTPS and restrict who can connect.

  • Free
  • No Sign-Up
  • Runs in Your Browser

Examples:

Ports

1 of 41

Port Lookup

Port 21 at a glance

Port21
ProtocolTCP
ServiceFTP
Open to the Internet?Only to addresses that need it
See What Is Listeningss -lntup | grep ':21 '
Test From Outsidenc -zv your-server 21
Block with UFWufw deny 21/tcp
Block with nftablesnft add rule inet filter input tcp dport 21 drop

FTP uses TCP port 21. The FTP control connection for logins and commands.

A constant target of password guessing, and unencrypted. Replace with SFTP, or use FTPS and restrict who can connect.

Allow port 21 only from the addresses that need it: your office, a VPN or a bastion host. The firewall rule generator builds those rules for nftables, iptables and UFW.

Questions

What is port 21 used for?
FTP. The FTP control connection for logins and commands.
Is it safe to open port 21?
Only to addresses that need it. A constant target of password guessing, and unencrypted. Replace with SFTP, or use FTPS and restrict who can connect.
How do I check if port 21 is open?
On the server, ss -lntup | grep ':21 ' shows what is listening. From another machine, nc -zv your-server 21 shows whether the firewall lets it through.
How do I block port 21?
With UFW: ufw deny 21/tcp. With nftables, add a drop rule for dport 21 in your input chain.

Abuse from open ports on your VMs?

Frabs spots amplification, scans and floods leaving any VM and stops them, without touching your firewall.