How to change SSH port in Linux Print

  • ssh, port
  • 0

By default your SSH port is 22 but you can change it to another port for added security. To change your SSH port on your Linux server.

1. Connect to your server via SSH using root user.

2. Run the following command:
vi /etc/ssh/sshd_config

3. Locate the following line:
# Port 22

4. Remove the # and change 22 to your desired port number.

5. Restart the sshd service by running the following command:
service sshd restart


Was this answer helpful?

« Back