How to change SSH Port in CentOS?

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

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

  3. Locate the following line:
    # Port 22

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

  5. Restart the sshd service by running the following command:
    service sshd restart
  • change ssh port of server
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to access VPS by SSH for first time?

You need to download latest version of Putty.exe file here: https://putty.org/ Open...

What is the requirements to Buy Pakistan Hosted VPS?

We Provide Pakistan Hosted VPS Servers only to Pakistani Customers. VPS Servers are hosted in...

How to change server root password using SSH or VPS Portal?

Connect to your server via SSH as root user. Enter the command:passwd Type your password,...

How to Install CSF firewall in cPanel?

CSF firewall is fairly easy to install and require only few steps through SSH. Please follow the...

How to reinstall your VPS?

You can reinstall your OS by just login into Client area > Navigate to **[Service Section]...