August 2018
Intermediate to advanced
482 pages
12h 44m
English
Suppose we have many user accounts on the systems. We need to edit the /etc/ssh/sshd_config file in such a way that remote access is allowed only for few mentioned users:
sudo nano /etc/ssh/sshd_config
Add the following line:
AllowUsers tajinder user1
Now restart the SSH service:
sudo service ssh restart
Now when we try to log in with user1, the login is successful. However, when we try to log in with user2, which has not been added in the /etc/ssh/sshd_config file, the login fails and we get Permission denied error, as shown here:

Read now
Unlock full access