A port is a numbered channel a server uses for a particular service โ 443 for HTTPS, 22 for SSH, 3306 for MySQL. Each port that is open and reachable from the internet is part of your attack surface.
Common ports and the risk
- 80 / 443 โ web traffic; expected to be open.
- 22 (SSH) โ administration. Restrict to known IPs or a VPN; never leave it open to the world with password auth.
- 3306 (MySQL), 5432 (PostgreSQL), 6379 (Redis), 27017 (MongoDB) โ databases should never face the public internet. Exposed databases are a frequent cause of mass data breaches.
- 21 (FTP), 23 (Telnet) โ legacy and unencrypted; replace with SFTP/SSH.
Reducing exposure
Apply the principle of least exposure: close everything that does not need to be public, bind internal services to localhost or a private network, and put a firewall in front. A port scan shows which common ports respond on your host.