I would like to create another user like root
With smit user, I have duplicate all the configuration from root to root2 (groupe, secondary group, administrative, etc...)
But when I connect with root2, i don't go to all directory: "permission denied !"
I don't understand where is the problem ?
theres one more way to give a user the exact root priveldges....
the system considers a user as root only based on the uid and gid of the user...
for a root (uid=0 and gid=0)
so you can edit the /etc/passwd file and change the column where its shows the userID and the groupID of that user to 0 and 0, then that user will have all of root permissions.....
What alpha*test says is correct, but: Unix identifies users by looking up their UID/GID in /etc/passwd. Whoever comes first there will be shown as owner of files/directories, because the ownership is established not by storing the name but by storing the UID in the directories structure. Hence:
$ su - root2
# id
uid=0(root) gid=0(system) groups=2(bin),3(sys),7(security),8(cron),10(audit),11(lp)
# touch a_file
# ls -l
total 3496
-rwxr-x--- 1 root system 0 Jan 21 2006 file_created_by_root
-rwxr-x--- 2 root system 0 Jan 21 2006 a_file
#
You see, even when yo switch to root2 you look like you are root.
This configuration works fine but there is another problem though. If you do a ssh session to another server, the system will simply log you on as 'root' and not as the new user with root previleges. The new user however does exist on the other server and also has root previleges and the necessary SSH keys. Any ideas?
I think this goes back to what was said earlier. UNIX identifies the user by the UID, not the name. So if root2 is operating under UID 0, then it will still be seen as 'root' by the receiving system (the one you SSH to).