Port 21 — FTP control
TCP well-known
What runs on port 21
The command channel for FTP: login, directory listings and transfer commands.
Security considerations
Credentials travel in clear text. Anything exposed to the internet on port 21 will be found by scanners within hours.
Checking whether something is listening
# Linux / macOS — what is bound to the port
sudo lsof -i :21
sudo ss -lntp | grep :21
# Windows
netstat -ano | findstr :21
Get-NetTCPConnection -LocalPort 21
# is it reachable from outside?
nc -zv example.com 21
curl -v telnet://example.com:21
Freeing the port
# find the process, then stop it
sudo lsof -ti :21 | xargs kill # Linux / macOS
netstat -ano | findstr :21 # note the PID, then:
taskkill /PID <pid> /F # Windows