What’s the Deal with User Groups in Linux?

0
2
Asked By CuriousExplorer88 On

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?

3 Answers

Answered By FileAccessGuru On

Think of groups as a way to control access without making everything public or just for one user. For example, if you have a folder owned by a group, members of that group can read or execute files there based on permissions. It's common for systems to have default user groups, but how many you need really depends on your use case. Whether it’s for a personal desktop or a server, groups help manage access efficiently.

AccessNinja -

Exactly, and being part of multiple groups can be really useful! It lets you have just the access you need without compromising security.

UserManagementPro -

Yeah! It allows flexibility in managing permissions so you can easily adjust who can access what.

Answered By UnixWizard97 On

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.

Answered By TechSavvyDude42 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.