Here, we will discuss how the login capabilities of users can be restricted on a Linux system:
- We can restrict the access of a user account by changing the login shell of the account to a special value in the /etc/passwd file. Let's check the details of an account, user1 as an example, in the /etc/passwd file, as shown here:

- In these details, the final value for the user1 account is set to /bin/bash. At present, we can log in from the user1 account. Now, if we want to change the shell of the user account we wish to restrict, we can do so as shown here:
- If we try to log in from user 1 now, we get the following error: