Changing the SSH port

Changing your SSH port reduces the security exposure of your server.

  1. Open the SSH configuration file:

    pico -w /etc/ssh/sshd_config
    
  2. Find this line in the file:

    #Port 22
    

    Remove the # at the start and replace 22 with the port number you want to use.

  3. Press Ctrl + X to save and exit.

  4. Restart the SSH service:

    /etc/rc.d/init.d/sshd restart
    
Was this article helpful?