Video Walkthroughs at Superb Internet
close
Domain Name / Customer ID:

Password:

Forgot Password

All material © 1996 - 2024 Superb Internet Technologies Inc. // version-1.50.33
« Back to all videos

Changing SSH port

Change the default SSH Port

As the second video in this series on making SSH access to a CentOS Linux server more secure, this tutorial will show you:

How to Change the Default SSH Port in CentOS

  1. To change the default SSH port, which is 22, at the command prompt type
    sudo vi /etc/ssh/sshd_config
    and press Enter. This will bring up the sshd server system-wide configuration file.
  2. Locate the #Port 22 line immediately below the introductory text, place your cursor at the end of the line, press Insert, and press Enter. Then type
    Port [your custom port]
    where your custom port is any unassigned port number (in this tutorial, the new SSH port number is 19350 Press the Esc key
  3. Then, type :w and press Enter to save the file, and type :q and press Enter to exit the vi editor.
  4. In order for changes to take effect, restart the SSH service by executing
    sudo service sshd restart
    at the command prompt.
  5. Logout from the server You will now be able to connect to your server using the custom SSH port number that you set. Be sure to see the next video in this series: How to Create and Use SSH Keys with PuTTY


comments powered by Disqus