I'm trying to wrap my head around the concept of user groups in Linux, especially when I add a user with a command like `useradd -mG *groups* *username*`. I understand that I'm making a home directory for the user and adding them to a specific group, but I'm puzzled about groups in general.
I often see people adding their users to the `wheel` group, mostly for `sudo` access, but I don't really use `sudo` myself, so I'm questioning the need for it. Could there be hard dependencies on this group, especially since it seems pretty common?
What confuses me more is that some users add their accounts to multiple groups like `audio`, `video`, and so on — why do they do that? Are there groups that are mandatory, or can I just create my own? For instance, could I make a `thisisroot` group and use that with my `doas` config?
2 Answers
UNIX groups are designed to manage access to resources. The `wheel` group typically allows specific users to use the `su` command, historically giving them more control over the system. If you're using devices like audio hardware, you'd need to be part of the `audio` group for access. So, while groups can be optional, they are often essential depending on the setup of your system.
Groups are all about permissions! When you add a user to a group, they gain access to whatever permissions that group has. For instance, if you're using VirtualBox, you need to add your user to the `vboxusers` group to use USB devices in virtual machines. So, each group has its reason for existing and can unlock specific functionalities.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures