Page 1 of 1

How to diff between 2 users with uid 0

Posted: Sun Mar 24, 2013 4:32 am
by urip
Hello,
I created a new user "rootNew"
After creation I manually change the file /etc/passwd and gave the new user "rootNew" uid 0.
Now I have 2 users with uid 0 (root,rootNew).
"whoami" command return "root" for both users.
How can I know which user is log in the system?

Thanks,
Uri

Re: How to diff between 2 users with uid 0

Posted: Sun Mar 24, 2013 7:11 am
by karlchen
Hello, Uri.

UIDs on a Linux system have to be unique. This means there can only be one single user having the UID 0. Creating a second user and assigning UID 0 to him will have no visible effect at best or result in some things malfunctioning.
User root is the Linux superuser. You cannot clone this account. root must exist, be named root and have UID 0.
End of the story.

Kind regards,
Karl

Re: How to diff between 2 users with uid 0

Posted: Sun Mar 24, 2013 8:01 am
by Pierre
instead of creating 'rootnew' - call the account Admin & have a higher uid than 0
then, on the user privileges tab - give the account holder, the same privileges as root.

this can be done with any account holder .. ...

Re: How to diff between 2 users with uid 0

Posted: Sun Mar 24, 2013 10:32 am
by karlchen
Hello, Pierre.

And what would be the benefit of having a second root-like account?

Karl

Re: How to diff between 2 users with uid 0

Posted: Sun Mar 24, 2013 11:52 pm
by Pierre
Now I have 2 users with uid 0 (root,rootNew).
"whoami" command return "root" for both users.
How can I know which user is log in the system?
he currently has two root accounts, that he can't separate.

so, he needs to alter the second one, - to another user name, & give it root privileges.

then he will know - which user is logged into the system. .. .