Changing the default SSH port

  1. Open the /etc/ssh/sshd_config file.

    sudo nano /etc/ssh/sshd_config
  2. Change the SSH port and save the file.

    Port 5333
  3. Restart the SSH server to apply new configuration.

    sudo systemctl restart sshd
  4. Logout of your server and re-login using the new port.

    ssh <user>@<ip_addr> -p 5333

Specify -i if using private key to login.

Last updated