Changing the SSH Port for Your Linux Server

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

Make sure the new SSH port does not conflict with any known or blocked ports. Be sure to REMEMBER the SSH port as well.

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 sshdservice by running the following command:
    service sshd restart
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What is a Dedicated Server?

A dedicated server refers to the rental and exclusive use of a computer that includes a Web...

Removing RAID metadata

Sometimes a hardware RAID controller or fakeraid (BIOS) can leave metadata that makes it...

How To Understand the Filesystem Layout in Linux

If you are new to Linux and Unix-like operating systems, the basic ways to interact with and...

TIP: How to view your server processors and cores via command line

>Log in as root Type|: cat /proc/cpuinfo output:   or     cat /proc/cpuinfo   Either...

How to Install CSF Firewall and disable APF+BFD

In this guide we will walk you through installing and  configuring CSF – Config Server Firewall,...