Create root user account on Linux
Create extra root user account to your Linux box.
The ‘root’ account with user id 0 is the most powerful user in Linux and Unix system. This article show the step by step to create the duplicate root account that have the same privileges as super user root account on the Linux Fedora Core operating system.
You may want to make replicate of root user account, or to create more than one user account that have the same capabilities as a ‘root’ user (superuser) account.
Why? may be for a root backup user account, incase of something happen to the ‘root’ user account
To create another root user account, we need to replicate the ‘root’ user account characteristic, then make one account that have the same characteristic and capabilities of the ‘root’ user account.
Let begin by check the ‘root’ user account.
1. Check user id for ‘root’ user account:
[[email protected] ~]# id root
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Explanations of the command output:
A. uid=0(root) The user id for user ‘root’ user is 0.
B. gid=0(root) the group id for user ‘root’ is 0.
C. groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) The user ‘root’ is belong in groups; root, bin, daemon, sys, adm, disk and wheel.
2. Now we take a look at the passwd, shadow and group files that contain ‘root’ user information:
[[email protected] ~]# less /etc/passwd
[[email protected] ~]# less /etc/shadow
[[email protected] ~]# less /etc/group
From the information gather above, to create a user that have the same power (superuser power) as a ‘root’ user in Linux system, we need to create a user with same root user uid, gid and group.
3. To create user account that has the same ability (super user) as the ‘root’ user, issue this command:
[[email protected] ~]# /usr/sbin/adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M ugat
Adduser command explanations:
adduser : Using Linux adduser command to create a new user account or to update default new user information.
-u 0 -o : Set the value of user id to 0.
g 0 : Set the initial group number or name to 0
-G 0,1,2,3,4,6,10 : Set supplementary group to: 0 = root 1 = bin 2 = daemon 3 = sys 4 = adm 6 = disk 10 = wheel
-M : home directory’ not created for the user.
ugat : User name of the new user account.
Note: you need to have the administrative privilege on the system in order to issue ‘adduser’ command above.
4. Now add a password for user ‘root2’ by issue the ‘passwd root2’ command, see example below:
[[email protected] ~]# passwd ugat
Changing password for user ugat.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.