
If you try to login as any of the above users, you will get permission denied. Similarly, to deny a specific user from logging in via SSH, you simply use the DenyUsers or DenyGroups option with a list of users or groups to deny access respectively.

If you try to login as a user who is not a member of the administrators group, you will get permission denied. This will allow only the members of the administrators group login getent group administrators To allow a specific group of users to login, you would add the following line to SSHd configuration file AllowGroups administrators

If you check authentication logs, it states clearly Mar 27 19:46:07 u18svr sshd: User mibey from 192.168.0.101 not allowed because not listed in AllowUsers Now, if you try to login as any other user apart from the two allowed above, you should get permission denied.
