HTTPfy

Port 2022 (SSH alternate (2022))

Another common alternate SSH port, used by some NAS and container setups.

Registered (user) port, 1024-49151 TCP Remote access Expose only to trusted sources

What port 2022 is used for

Another common alternate SSH port, used by some NAS and container setups.

Security: should port 2022 be open?

Expose only to trusted sources. Same hardening as port 22.

IANA assignment

IANA lists port 2022 as unassigned. No service is registered for it.

Check what is listening on port 2022

Linux: is anything listening on TCP 2022?
sudo ss -tlnp 'sport = :2022'
Linux / macOS: which process owns the port
sudo lsof -nP -i :2022
Older Linux / BSD (net-tools)
sudo netstat -tlnp | grep ':2022 '
Windows (Command Prompt)
netstat -ano | findstr :2022
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 2022 -State Listen | Select LocalAddress,OwningProcess

Test it from outside

From another machine
nc -vz -w 5 HOST 2022
From Windows
Test-NetConnection HOST -Port 2022

Allow only trusted sources on port 2022 in the firewall

Replace 203.0.113.10 with the address or network you trust. With ufw, make sure the default incoming policy is deny.

ufw (one trusted source)
sudo ufw allow from 203.0.113.10 to any port 2022 proto tcp
iptables
sudo iptables -A INPUT -p tcp --dport 2022 -s 203.0.113.10 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 2022 -j DROP
nftables
sudo nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 2022 accept
sudo nft add rule inet filter input tcp dport 2022 drop
Windows Firewall
New-NetFirewallRule -DisplayName 'TCP 2022 trusted' -Direction Inbound -Protocol TCP -LocalPort 2022 -RemoteAddress 203.0.113.10 -Action Allow

Related ports

All port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.