Why does root belong to any groups in a Centos 5.8 new install?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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..
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.