Changing SSH Port In Linux

Posted by Muzammil | Posted in , , , , , , , , , , , | Posted on 5:59 AM


SSH 
         
         SSH is the most secure way to access your Linux machine. In actual SSH has a default port. Changing the port may help you in step one of securing your Linux machine. Below are the steps you need to follow for ensuring port change for SSH.




STEP 1:

Login into your command line

STEP 2: 


# cd    /etc/ssh         PRESS ENTER
#ls

Search for the file "sshd_config" and open it in EDITOR MODE using the below command:

#vi sshd_config

Once the file is opened, search for the line that contains the word in red
"Port 22"

Assuming that we want to use port 200 for SSH. Replace the number 22 with 200. It will appear now as:
"Port 600"


To save the file, use the following key combination in purple:
ESC + : + x


STEP 3:

The last step is to write the below line in the CLi interface:

service sshd restart

Comments (0)

Post a Comment