User and Group

incedis

Member
Joined
Jul 16, 2021
Messages
79
Reaction score
13
Credits
801
Probably a dumb question for most of youse but asking any ways..
I am trying to understand user and group in Linux and found that my user has a group of the same name.
1641639266900.png
Why is that ?
 


The group name with the same name as your user is your user's primary group, all the others are secondary groups.
 
is there any specific reason for creating this group ? In simple terms please. I have read a lot of post and article about it but I am failing to understand the reason behind it..
 
Having a group with your own username gives you an extra bit of privacy, it restricts who can access your files a bit more.

In the file permissions you have three sets of permissions: Owner, Group and Others.
All files/directories have an owner and a default group owner.

If your home directory is owned by you and the group ownership is set to "users", which is typically a group that all users are added to, then that would mean that the "owner" permissions on files and directories in your home directory are applied to you.
The group permissions on files/directories would apply to any all users in the "users" group and the ‘other’ permissions apply to any other users who are not you and are not in the "users" group.

So your files are accessible to you, and other users on the system who are in the users group get group access to your files, and anybody else uses the more restrictive "others" permissions.

Now, consider this. If your home directory is owned by you and the group owner is a group with your username - which is a group which only has you as a member, that means the owner and group permissions on all of the files/directories apply to you and you alone. All other users on the system can only use the "other" permissions.

So having a group with your name, which only has you as a member is a way of further restricting who can access your files!
 
A fundamental reason that groups are built into Unix systems is that Unix was conceived of initially to be a multi-user system from the outset, unlike some other OSs. That notion was derived from the wish for freedom to share information between individuals and groups in the tradition of scientific communities progressing their work.
 

Members online


Top