0

how to block creating new user in linux

Hello,

Am using redhat OS. I need to restrict creating the new user either from root or user with sudo access... Is it possible to do so???

Advanced commands Add a comment
michael
asked Feb 08 2017

Answer

0

It is possible by many ways, the simple is to use chattr command. If the new user is to be created in Linux, at first it will redirect to the /etc/passwd file. So if that file is restricted to access using chattr command, either root user or the user with sudo access cant able to add the new user....

# chattr +i /etc/passwd

This command will restrict the access to create new user... To revert back run the same command by replacing with -i

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