Wednesday, October 29, 2008

Changing The Port Number at SSH

Changing The Port Number at SSH

We can change the port number of ssh. By default the port number of ssh is 22. To change the port address we have to edit the file /etc/ssh/sshd-config. We can do this with the following command.
vi /etc/ssh/sshd-config
In this file we will find a line
port 22
We will replace the 22 with 29 and then save the file.
Now we will restart the service sshd.
service sshd restart
/etc/init.d/sshd restart
Now to ssh at this server or os we have to write the following line
ssh -p 29 root@192.168.100.5

No comments: