System Administration

Tuesday, 14 June 2022 07:50

Allow Specific Users to Login via SSH

Written by 
Rate this item
(0 votes)

In order to allow specific users or a specific group of users to login to a Linux system via SSH, AllowUsers or AllowGroups options can be used in SSH daemon configuration file, /etc/ssh/sshd_config.

For example, to allow users, amos and admin to login, edit the SSHd configuration file and add the line below;

vim /etc/ssh/sshd_config
...
AllowUsers amos admin

Once changes are made, restart SSH.

systemctl restart ssh
Now, if you try to login as any other user apart from the two allowed above, you should get permission denied.

Read 338 times