How to diff between 2 users with uid 0

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
urip

How to diff between 2 users with uid 0

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18222
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: How to diff between 2 users with uid 0

Post 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
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
User avatar
Pierre
Level 21
Level 21
Posts: 13222
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How to diff between 2 users with uid 0

Post 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 .. ...
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
karlchen
Level 23
Level 23
Posts: 18222
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: How to diff between 2 users with uid 0

Post by karlchen »

Hello, Pierre.

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

Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
User avatar
Pierre
Level 21
Level 21
Posts: 13222
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How to diff between 2 users with uid 0

Post 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. .. .
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Locked

Return to “Beginner Questions”