Secure Shell: remote shell access, SFTP and scp file transfer, Git over SSH and port forwarding. OpenSSH listens here by default.
Secure Shell: remote shell access, SFTP and scp file transfer, Git over SSH and port forwarding. OpenSSH listens here by default.
Expose only to trusted sources. One of the most scanned ports on the internet; expect constant password-guessing bots. Disable password login (PasswordAuthentication no), use keys, disable root login, and limit access to known IPs, a VPN or a bastion host. fail2ban or sshguard cut the noise. Moving SSH to another port reduces log spam but is not a security control.
Registry dates for this port: last modified 2022-02-07.
sudo ss -tlnp 'sport = :22'sudo lsof -nP -i :22sudo netstat -tlnp | grep ':22 'netstat -ano | findstr :22Get-NetTCPConnection -LocalPort 22 -State Listen | Select LocalAddress,OwningProcessnc -vz -w 5 HOST 22Test-NetConnection HOST -Port 22Replace 203.0.113.10 with the address or network you trust. With ufw, make sure the default incoming policy is deny.
sudo ufw allow from 203.0.113.10 to any port 22 proto tcpsudo iptables -A INPUT -p tcp --dport 22 -s 203.0.113.10 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -j DROPsudo nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 22 accept
sudo nft add rule inet filter input tcp dport 22 dropNew-NetFirewallRule -DisplayName 'TCP 22 trusted' -Direction Inbound -Protocol TCP -LocalPort 22 -RemoteAddress 203.0.113.10 -Action AllowAll port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.