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 to Deny SSH access for a specific User
Login as a root user in order to edit “sshd_config” file. Open this file in vi editor.
Insert below line in sshd_config file.
DenyUsers user0 user1 user2
Save and Exit
Step 2: Now restart ssh service using below command.
Service sshd restart
Now user0, user1 and user2 are not allowed to access Linux box via ssh.