0

how to restrict the login access of a particular user

In my linux,i just want to deny some users from logging in.how to block the particular users

User management command Add a comment
wyatt
asked Feb 23 2017

Answer

0

You can restrict the login access of a particular user using two ways

1)Using the passwd command

To lock the user from accessing the desktop environments like gnome desktop ,use the following command.

passwd -l username

Ex: passwd -l user1

This command will block the gnome desktop access for the particular user but you can access the restricted user through the terminal.

2)By editing the /etc/passwd file

Open the /etc/passwd file using the root For restricting the user login,give the user information line and edit the shell type Change the shell type from /bin/bash to /bin/nologin.

Now save the file and exit.

Now the users are restricted from accessing the desktop environments like gnome desktop.

Add a comment
krishnakumar
asked Feb 23 2017
edited Oct 05 2018
Post your Answer