Centos 6.8
Attempt to create a new root user

adduser root_2
passwd root_2
Changing password for user root_2.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

run visudo, locate the line with root, clone the line and make it for root_2


## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
root_2    ALL=(ALL)       ALL

save and quit


switch to user root_2 and test to see if it behaves like root account

su root_2

reboot: Need to be root

let's also try this stuff that I find on the web.

as root

usermod -aG wheel root_2
su root_2
reboot: Need to be root

again.. no success..

mission failed.

What Am I Missing ?


There can only be one root user: the user with user id 0. From the point of the system, user accounts are small integer numbers. The alphanumeric names are just a convenience for the operator. The new user root_2 does not have user id 0, so it is not root by definition.

By editing the sudoers file you have given root_2 the right to run any command anywhere using sudo. You did not make it equivalent to root, because only user id 0 is root.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy