The most common non-standard SSH port: used for a second SSH daemon, Gitea/GitLab containers' SSH, DirectAdmin and honeypots.
The most common non-standard SSH port: used for a second SSH daemon, Gitea/GitLab containers' SSH, DirectAdmin and honeypots.
Expose only to trusted sources. Same rules as port 22: keys only, no root login, allowlist where possible. Scanners check 2222 right after 22.
sudo ss -tlnp 'sport = :2222'sudo lsof -nP -i :2222sudo netstat -tlnp | grep ':2222 'netstat -ano | findstr :2222Get-NetTCPConnection -LocalPort 2222 -State Listen | Select LocalAddress,OwningProcessnc -vz -w 5 HOST 2222Test-NetConnection HOST -Port 2222Replace 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 2222 proto tcpsudo iptables -A INPUT -p tcp --dport 2222 -s 203.0.113.10 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 2222 -j DROPsudo nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 2222 accept
sudo nft add rule inet filter input tcp dport 2222 dropNew-NetFirewallRule -DisplayName 'TCP 2222 trusted' -Direction Inbound -Protocol TCP -LocalPort 2222 -RemoteAddress 203.0.113.10 -Action AllowAll port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.