Knowledgebase

How to change the SSH port of a Linux Hosting Server ?

Step 1 : Login to your server as Root

Step 2 : Look for the sshd_config file (it can be found in /etc/ssh directory) and edit it

vim /etc/ssh/sshd_config

Step 3 : Search for a line that has :

Port 22

Step 4 : Amend the port number with something of your preference.

Note : You must ensure that the new port number is free and isn’t used by any other service.

Step 5 : Once you are sure about the changes, make sure that you Save the file

Step 6 : You may then restart sshd using the following command :

/etc/init.d/sshd restart

Step 7 : Make changes to the firewall with blocking Port 22 and allowing the new Port number used by SSH.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search


 Copyright (c) 2008-2012 Hostmasti payments