Saturday 20 July 2013

DENY SSH LOGIN FOR SOME USERS

Deny SSH access for a specific user

Sometime we required to deny specific user’s SSH access on Linux box due to security reasons.
In this tutorial i am going to show you simple steps for “How to Deny SSH Access for A Specific User”

Step 1:
Login as a root user in order to edit ‘sshd_config’ file. Open this file in vi editor.

vi /etc/ssh/sshd_config

Insert below line in sshd_config file.

DenyUsers  user0 user1 user2

Save and Exit

:wq

Step 2: Now restart ssh service using below command.

Service sshd restart

That’s all

Now user0, user1 and user2 are not allowed to access linux box via ssh

No comments:

Post a Comment