0

How to disable the user from login to Linux

I need to disable the particular user from login. Only after my authentication the respective user should login. How the setup is to be done ???

Advanced commands Add a comment
carter
asked Feb 09 2017

Answer

0

This can be done by two ways. Either by using usermod with nologin option or --lock option.

  1. To restrict login using nologin, run the below command.

    # usermod -s /sbin/nologin [USERNAME]

  2. To restrict using --lock option,

    # usermod --lock [USERNAME]

Add a comment
jagannatharumugam
asked Feb 12 2017
edited Oct 05 2018
Post your Answer