Very basic question but can you confirm

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Very basic question but can you confirm

Post by alex.barylski »

Is the root of the super user (root) always (at least) ZERO?

I know other users can be root, or at least given root access, but is the first user created (presumably) always super root and UID of ZERO?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Very basic question but can you confirm

Post by VladSun »

Confirmed! :)
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Very basic question but can you confirm

Post by alex.barylski »

Cool thank you.

Can you change that user to have no privies at all? Or is that every other user only?

Seems weird (from using databases) why any user would have ID zero...typically I use that value to indicate invalid user when authenticating...
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Very basic question but can you confirm

Post by VladSun »

PCSpectra wrote:Can you change that user to have no privies at all? Or is that every other user only?
I'm not sure what you mean. You can change the name of superuser from root to anything else. And you can make any user a superuser by chaning its UID/GID to 0/0.
PCSpectra wrote:Seems weird (from using databases) why any user would have ID zero...typically I use that value to indicate invalid user when authenticating...
You may use -1 ;)
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Very basic question but can you confirm

Post by alex.barylski »

I'm not sure what you mean. You can change the name of superuser from root to anything else. And you can make any user a superuser by chaning its UID/GID to 0/0.
There can only ever be one super user, though? Can more than one user have the UID 0?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Very basic question but can you confirm

Post by Luke »

VladSun wrote:
PCSpectra wrote:Seems weird (from using databases) why any user would have ID zero...typically I use that value to indicate invalid user when authenticating...
You may use -1 ;)
Yup, use -1 man, that's the way I do it. :)
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Very basic question but can you confirm

Post by VladSun »

PCSpectra wrote:There can only ever be one super user, though? Can more than one user have the UID 0?
While useradd will complain that it's not a unique UID, you can always edit /etc/passwd ;)
Try and see it :)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply