Cybersecurity

Move SSH to another port

Test the new port before retiring the old one.

Networks and access Author · Iulian Aldea ·
Editorial date · 2026-11-30

Visual example for: Move SSH to another port
  1. Before starting, check the current listening ports and keep the provider console available.
  2. ss -lnt
  3. Add the new port alongside the old one in the SSH configuration. Check whether your distribution uses ssh.socket before reloading.
  4. sudo sshd -t
  5. Apply the configuration after validation succeeds and the firewall permits TCP on the new port.
  6. ssh -p 10022 user@server
  7. Confirm key login in a second window. If it fails, use the old session to correct the configuration.

All guides