Create a duplicate ROOT id
Monday, February 11, 2008
Duplicating a ROOT id is not a good idea, as this will overkill the security risk. SUDO is another workaround option that you can look into without implementing the 2nd ROOT id. Anyway, below are steps taken by me to create the 2nd ROOT id.
1. Backup all the required files (/etc/passwd, /etc/shadow and /etc/group)
2. Create the user with useradd command
Example
# useradd -g 1 -d /export/home/root2 -s /bin/sh -c "Some infor here" root2
Syntax for useradd
useradd [-u uid [-o] | -g group | -G group[[,group]...] |-d dir |
-s shell | -c comment | -m [-k skel_dir] | -f inactive |
-e expire | -A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value | -p project [, project ...]] login
3. Change passwd for root2
# passwd root2
4. Edit the /etc/passwd file. Search for the id that you have created, in this case root2
root2:x:116:1:Some Info here:/export/home/root2:/bin/sh
In this case the UID is 116. This number is automatically generated unless you have specified the -u option with your useradd command. Use vi editor to edit, change the UID number from 116 to 0
# vi /etc/edit
5. Now all you need to do is update the /etc/passwd file with the command below
# pwconv
pwconv - installs and updates /etc/shadow with information from /etc/passwd
To now more on pwconv, do a man pwconv
