LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-06-2012, 12:56 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Why does root belong to any groups in a Centos 5.8 new install?


Hi,

When doing a new Centos 5.8 installation, I found that the root user was assigned to several groups (see below). My understanding is that root is all powerful and I don't understand what the point of adding root to 1(bin), 2(daemon), 3(sys), 4(adm), 6(disk), and 10(wheel) is. Any thoughts? Thanks

[root amp; localhost ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

PS. I accidentally posted a similar message (and two others) to a non-linuxquestions.org forum, but meant to only do so at this one. I am not a "double poster" by nature, and apologize in advance.
 
Old 08-06-2012, 01:00 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
This is by design to allow root access to files that require that group membership and are not owned by the root user. These can be daemon files, special character device files, etc..
 
Old 08-06-2012, 01:21 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks Kustom42,

I thought that root has access to all files regardless of whether root owns them or root belongs to an associated group.

Is this not the case?
 
Old 08-06-2012, 02:28 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Quote:
Originally Posted by NotionCommotion View Post
Thanks Kustom42,

I thought that root has access to all files regardless of whether root owns them or root belongs to an associated group.

Is this not the case?
Yes and no, root does have full control over the filesystem but for things to work fluidly it should have the correct perms on the files/folders by default.

Try creating a file with perms 000 and vi into it as root. It will not let you write it with the default ":wq" and you must invoke the ":wq!" to force write as the root user. For daemons and other things that run in the background having the correct permissions by adding the root user to its group allows it to execute without any error.
 
2 members found this post helpful.
Old 08-06-2012, 03:37 PM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks again Kustom42. Makes total sense.

Not a bad question, though, for a newbie
 
Old 08-08-2012, 01:20 PM   #6
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Wink

Quote:
Originally Posted by NotionCommotion View Post

Not a bad question, though, for a newbie
The only bad questions are the ones you don't ask
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How many Secondary groups can user belong to on RHEL 5 server? sieben Linux - Server 0 02-03-2009 02:49 PM
Restore root groups on Fedora seses Linux - Newbie 3 02-02-2009 03:00 AM
Does root belong to all groups - Permissions Question Cocytus1 Linux - Newbie 4 04-26-2008 03:50 PM
show processes than don't belong to user root jianelisj Linux - Newbie 2 03-06-2008 11:31 PM
No Volume groups found in CentOS-5 boot-up but works in USB caddie but not in PC robrich Linux - Newbie 0 01-08-2008 08:51 AM

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

All times are GMT -5. The time now is 09:21 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