How to create a secondary root user on CentOS

Lets show you how to create a secondary root user.
To add a user and allow him the root privileges by editing the /etc/passwd file. Add a user as root
# useradd newuser

set a password for the new user

# passwd newuser

Once done, edit the ‘passwd’ file

# vi /etc/passwd

set the UID:GUD bits to 0:0. Say for example the new user is ‘admin’, the line should look like

Quote:
admin:x:0:0::/home/admin:/sbin/nologin

Note: This method increases the security risk on the server and the best method is to add the new user in the sudoers list. You can also allow a list of commands for the new user beyond which he won’t be able to execute any commands as root.

0 Shares:
Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like