Port 22 is the standard port for SSH (Secure Shell), SFTP (SSH File Transfer Protocol), and SCP (Secure Copy). All three use the SSH protocol for encrypted communication. Port 22 should be protected with public-key authentication and rate limiting – it is the most attacked port on the internet.
Port Number
22
Protocol
TCP
Service
Secure Shell
Range
IANA Well-Known (0–1023)
Verbose SSH connection debugging – shows key exchange, auth methods, and failures
ssh -vvv user@host 2>&1 | grep -E '(debug1|Authenticated)'Count active SSH connections
ss -tnp sport = :22 | wc -lCount brute-force attempts in the last hour
journalctl -u sshd --since '1 hour ago' | grep -c 'Failed password'Audit SSH server configuration – algorithms, key sizes, vulnerabilities
ssh-audit hostssh [email protected]
ssh -p 22 [email protected]
sftp [email protected]
scp file.txt [email protected]:/path/SSH was created by Tatu Ylonen in 1995 after a password-sniffing attack at Helsinki University of Technology. SSH-1 was proprietary; SSH-2 (RFC 4251, 2006) was standardized by the IETF. OpenSSH (1999) became the universal implementation, shipping with every Linux, macOS, and Windows 10+ system.
Should I change SSH from port 22 to a non-standard port?
It reduces automated scanner noise in logs (~99% of bots only probe port 22) but provides zero security against targeted attacks. Do it for log cleanliness, not as a security measure. Key-based auth + fail2ban is the real protection.
Is SFTP the same as FTPS?
No. SFTP runs inside SSH (port 22, single connection). FTPS wraps FTP in TLS (ports 990/989 or STARTTLS on 21, dual channel). They are completely different protocols that happen to transfer files securely.