Change the SSH port on RedHat/Cent Os

Changing the SSH port of RedHat or Cent Os is not a tough job. Any administrator can change it by just editing sshd_config file and then reloading the service.

Step 1. Edit the sshd_config

vi /etc/ssh/sshd_config

Step 2. Change the Port No
You will find something like

#Port 22

Simply change this like

Port 2222

Step 3. Save and Exit
Step 4. Reload the New Configuration
service sshd reload
You are done and now you can test your new configuration using this command

ssh username@myhostnaname.com -p 2222

Precaution: Before logging out make sure your 2222 or the port you have set is open. Otherwise you will no be able to log in using that port. Check your firewall settings for this.

About Saifur

A passionate software engineer, having several years of experiences in different area of software industry in Europe and Asia loves music, playing soccer, traveling new places, researching on new technologies such as programming languages, frameworks, software architectures and different project management practices.

, , ,

No comments yet.

Leave a Reply


*