Port 2222 is a common alternate SSH port used to reduce automated brute-force attacks against port 22. Moving SSH to 2222 provides zero security against targeted attacks but eliminates 99% of automated scanner noise from logs. DirectAdmin hosting panel also uses port 2222 for its control panel interface.
Port Number
2222
Protocol
TCP
Service
SSH (non-standard port)
Range
IANA Registered (1024–49151)
Connect to SSH on alternate port
ssh -p 2222 user@hostFingerprint what service is actually on 2222 (SSH vs DirectAdmin vs honeypot)
nmap -sV -p 2222 targetAudit SSH config regardless of port
grep -E 'Port|PasswordAuthentication|PermitRootLogin' /etc/ssh/sshd_configCheck fail2ban protection status for SSH (works on any port)
fail2ban-client status sshdssh -p 2222 user@host
sshd_config: Port 2222
nmap -p 2222 targetPort 2222 became popular as an 'alternate SSH' in the early 2000s when automated SSH brute-force botnets targeted port 22 exclusively. Security guides recommended changing the SSH port to reduce log noise. DirectAdmin (hosting panel, 2003) also adopted port 2222. Over time, scanners evolved to check common alternates, making the security benefit negligible. Modern best practice: keep SSH on 22, use key-based auth, and deploy fail2ban.
Is changing SSH to port 2222 worth it?
Marginally. It reduces automated scan noise in logs (fewer failed password attempts from basic botnets) but provides zero protection against targeted attacks. Shodan fingerprints SSH on any port. Better investments: PasswordAuthentication no (key-only), fail2ban (auto-ban after 3 failures), AllowUsers (whitelist), and keeping OpenSSH updated. If you change the port, use something truly random (e.g., 47293) not a common alternate.
How do I tell if port 2222 is SSH or DirectAdmin?
nmap -sV -p 2222 target identifies the service. SSH shows 'OpenSSH' banner. DirectAdmin shows an HTTP response (it's a web panel). You can also: curl http://target:2222/ – if you get HTML, it's DirectAdmin; if connection hangs/refuses, it's SSH. On the server: ss -tlnp | grep 2222 shows the process (sshd vs directadmin).