Changing the SSH port for Linux server (VPS & Dedicated server)

Changing the SSH Port for Your Linux Server

You can change the default SSH port for your Linux server as an added security measure.

 Warning: Make sure the new SSH port does not conflict with any known or blocked ports.

To Change the SSH Port for Your Linux Server

  1. Connect to your server via SSH.
  2. Switch to the root user.
  3. Run the following command:
    vi /etc/ssh/sshd_config
  4. Locate the following line:
    # 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
  7.  

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Configure CentOS 6 Network Settings

Overview This tutorial will walk you through configuring your network configurations on CentOS...

cPanel/WHM Locations of Logs

CPANEL LOGS     cPanel Access Log     cPanel Apache Log     cPanel Backup Log...

How to Enable SSH Password Authentication

Some server providers, such as Amazon EC2 and Google Compute Engine, disable SSH password...

How to enable or disable public key authentication in SSH

SSH server in most systems is by default configured to allow public-key authentication. The...

Install iRedMail Server on Ubuntu 20.04|18.04

This tutorial will show you how to install iRedMail Email Server on a Linux server running Ubuntu...