Why does every user have their own group

groupusers

One thing I've noticed in a lot of recent distros is that users all have their own groups with the same name as their user name. What's the purpose of that? Groups are made to group users together in some ways, such as users, management, IT, etc. Seems pointless to have all these single-user groups. I seem to recall Unix systems before did have everyone's default group be users.

Best Answer

Essentially, it's part of a strategy to mitigate some security concerns while allowing users a simple way to collaborate with less permission hassles.

Linux systems have what's called a umask, which dictates file and directory permissions assigned on creation. By default, this umask is usually 022 which creates files with 644 permissions (owner read/write, group read-only, other read-only) and creates the restrictive settings normally applied to new files and directories.

Unfortunately, the lack of read/write for the group means that you have to rely on the person who created the file to grant proper permissions for a group to edit it (and users are not always reliable regarding this).

Part of the way to help solve this is to set a umask of 002 which results in files with 664 permissions (owner read/write, group read/write, other read-only). But this could have unwanted side effects (e.g. team members could edit each others private files dependent on default groups). So each each new user becomes part of a default group with just one user (emulating the 022/644 scheme).

More on how this helps collaboration: https://security.ias.edu/how-and-why-user-private-groups-unix