An SSH server sometimes needs to keep port 22 available while adding another listener for a migration, firewall exception, or management network. Running sshd on multiple ports lets existing clients continue using the old endpoint while new clients test the alternate one.
OpenSSH creates a listener for each active Port directive in the server configuration. The same daemon, host keys, authentication rules, and user accounts answer on every configured port unless separate ListenAddress or Match rules change the scope.
Every new listener must fit the surrounding network policy. Keep a known-good session open, validate the configuration before restarting, open the additional TCP port in the host or upstream firewall when needed, and test a new login on each port before removing any old access path.
Keep a second SSH session, console, or out-of-band path available until both ports accept new logins.
$ sudo ss --tcp --listening --numeric --processes 'sport = :2222' State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
Header-only output means no local process is listening on port 2222. Use the checker only to normalize a requested port list; it does not test live listeners.
Tool: Port List Checker
$ sudoedit /etc/ssh/sshd_config
On systems that keep local sshd settings under /etc/ssh/sshd_config.d, place the same Port lines in the existing site-local drop-in instead of mixing package defaults and local policy.
Port 22 Port 2222
Keep the known-good port active until the new port has passed a separate login test.
$ sudo sshd -t
No output means sshd parsed the active server configuration and host keys successfully.
Related: How to test SSH server configuration
$ sudo systemctl restart ssh
Use sudo systemctl restart sshd on systems where the unit is named sshd.
Related: How to manage the SSH server service with systemctl
$ sudo ss --tcp --listening --numeric --processes '( sport = :22 or sport = :2222 )'
State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=15013,fd=8))
LISTEN 0 128 0.0.0.0:2222 0.0.0.0:* users:(("sshd",pid=15013,fd=6))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=15013,fd=9))
LISTEN 0 128 [::]:2222 [::]:* users:(("sshd",pid=15013,fd=7))
$ ssh -p 22 user@host.example.net whoami user
$ ssh -p 2222 user@host.example.net whoami user
If the local listener appears but this login times out from another host, check the host firewall, cloud security group, NAT rule, or network ACL for port 2222/tcp.