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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: