Deny root user for ssh

We can deny root user for ssh. For this we have to edit the sshd-config file. To do this we have to write the following command:

vi /etc/ssh/sshd-config

Now we will find out a line

PermitRootLogin=yes

We will replaced the yes with no.

PermitRootLogin=no

Now not only the root, but also all super user can not ssh at this ssh server.

To allow any user we have to add the following line at the last line of the configuration.

AllowUsers reza

This command will allow reza user.

AllowUsers reza nayem

This command will allow reza and nayem, both users.

We must have to restart the service after editing the file. Otherwise it wont work.

Any advice regarding this issue is highly expected.

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: