< -- BuySellAds Ad Code ALLEN -->
  • Home
  • Linux
  • Change SSH Port in Centos – Linux and Webmin

Change SSH Port in Centos – Linux and Webmin

By default SSH runs over port 22, this is well known and because of this it can be used for malicious reasons to try and access a websites core files or your Linux Servers. As part of improving security to a site you should make sure that you change the default port to something else. Here we will change the port in Centos 6.3 ( although this is for all flavors of Linux ) via command line and also change the SSH port via Webmin.

Change The SSH Port Number in Centos

First log in to your VPS or Centos Server and browse to the following path.


Once there you will see a file named SSHD_Config, we need to edit this. I use a file editor name nano, you can use your tool of choice. In my situation I run the following command.

nano sshd_config

you will see the config file open. Once open you can see the default port of 23, simply edit the value to the port number of your choice, I have used a random number here.
change ssh port in linux

Once done simply save and now when you use your SSH application such as Putty you will need to specify the new port number.

Change the SSH Port in Webmin

Again this is a very simple process, do change the SSH port in Webmin simply browse to the SSH server.

webmin ssh server port

Then select the edit option as seen below. Once done simply edit the config files default port from 23 to the port of choice and save.

change ssh port in webmin



Tags: centos, linux

Allen White

Allen is an IT Consultant and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5, 6 and HP ASE, AIS - Network Infrastructure.

Leave a comment



What Web Browser Do You Use?

View Results

Loading ... Loading ...


What do you prefer..VMware or Hyper-V?

View Results

Loading ... Loading ...