How to change the ssh port on Linux Print

  • ssh port, change ssh, change ssh port
  • 3

To Change the SSH Port for Linux Server

  1. Connect to your server via SSH
  2. Switch to the root user
  3. Run the following command:
    nano  /etc/ssh/sshd_config
  4. Locate the following line:
    # What ports, IPs and protocols we listen for
    # Port 22
  5. Remove # and change 22 to your desired port number.
  6. Restart the sshd service by running the following command:
    service sshd restart

After you’ve made the above changes, restart the SSH daemon to reflect changes and issue netstat or ss command to confirm that SSH service listens on the new TCP port.

systemctl restart ssh
netstat -tlpn| grep ssh
ss -tlpn| grep ssh

Was this answer helpful?

« Back

Powered by WHMCompleteSolution