LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2010, 02:59 AM   #1
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Rep: Reputation: 30
Differences between UID 0 and GID 0?


Anyone knows the differences between UID 0 and GID 0?
 
Old 02-24-2010, 03:14 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,352

Rep: Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331
uid=user id
gid=group id.

Each uid is unique on a system (usually) but gids(=groups) can have many uids(=users) in them
 
Old 02-24-2010, 04:02 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Rep: Reputation: 55
Quote:
Originally Posted by dwarf007 View Post
Anyone knows the differences between UID 0 and GID 0?
UID 0 refers to root's user ID.
GID 0 refers to group ID of the group root.

When the user account root is created by the system, group root will also be created at the same time with root as a single user in the group root.

You can add your username to root group, provided if you have previliges to do so.
 
Old 03-15-2010, 09:37 PM   #4
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
Does it mean UID 0 and GID 0 have the same privilege?
 
Old 03-15-2010, 09:47 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by dwarf007 View Post
Does it mean UID 0 and GID 0 have the same privilege?
No!!
Privileges are assigned to users and to groups independently.

Look at the definition of privileges: There are 3 levels: owner, group, and others. The get the owner privileges, you need to be the owner. To get the group privileges, you need to be a member of the group.
 
Old 03-15-2010, 10:00 PM   #6
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
actually uid 0 and gid 0 are arbitrary just as the accout name root, however standard on almost all unix/unix like systems
it would theoretically be possible to change the uid and gid of root to something else, albeit probably more difficult then it's worth
 
Old 03-16-2010, 04:52 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,352

Rep: Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331
@dwarf007: Read man chmod - that explains the permission system
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is uid and gid rmanocha Linux - Software 9 08-18-2008 11:03 PM
uid,gid from proc sanjaykhuntia Linux - Enterprise 1 10-28-2007 07:50 PM
cifs not using uid and gid mattd7591 Linux - General 10 07-19-2007 11:30 AM
What is my uid/gid? Jeebizz Slackware 2 11-22-2005 11:39 AM
changing uid, gid zeke1955 Linux - General 4 01-09-2004 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration