LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-02-2008, 06:07 AM   #1
Tomás Ó hÉilidhe
LQ Newbie
 
Registered: Feb 2008
Location: Southeast Asia (sunny!)
Distribution: Xubuntu
Posts: 28

Rep: Reputation: 15
User has its own group of the same name, why?


I installed Xubuntu on my laptop yesterday.

My main user, "toe", belongs to the group, "toe".

What reason is there to have a group dedicated to the user? I would have thought that "toe" would have been a member of "users" by default, but no it's a member of the group "toe".

Unless there's a good reason to leave things the way they are, I'm gonna change my group to "users", or I might make a new group called "admins".
 
Old 12-02-2008, 06:25 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I'm not clear on all the folklore behind how and why such things are done. In general, the whole point of a group is to have a convenient way of assigning the same privileges to multiple users. I suppose that having a group in your name gives you a way of personalizing a custom set of permissions.

I always look only at what groups a user is assigned to---eg audio, CDrom, printer administration, and the ever-popular "users"
 
Old 12-02-2008, 07:02 AM   #3
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
A toes is a toes by any other name.
 
Old 12-02-2008, 07:19 AM   #4
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
You can (and probably do) have multiple groups, so this isn't really an issue.
In the other hand depending on your umask and how your system groups are formed, having your own group for creating files (this is your main group) prevent other users from having access to them by just being on the same group.

i.e.
If your primary group is 'users' and other_user belongs to that group; and if your umask is something like 007 then other_user has read/write permissions on your newly created files.
 
Old 12-02-2008, 07:26 AM   #5
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Think about it. Users can be members of more than one group. If you want to share your files with others but not allow them to change the files you can make them members of your group with appropriate permissions (u+r--). You may not want all other users to be able to access your files so you don't want to make all users members of your group. It provides for maximum flexibility in file sharing. Unix and Linux were developed originally for computers which had hundreds and thousands of users connected so the file access is quite flexible.

File ownership and access is not set in stone and can always be changed. The default is to have owners in their own group. This can also be changed when establishing new users by making their files associated with any other group the administrator chooses.

Last edited by AuroraCA; 12-02-2008 at 07:28 AM.
 
Old 12-04-2008, 08:54 AM   #6
Tomás Ó hÉilidhe
LQ Newbie
 
Registered: Feb 2008
Location: Southeast Asia (sunny!)
Distribution: Xubuntu
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by AuroraCA View Post
Think about it. Users can be members of more than one group. If you want to share your files with others but not allow them to change the files you can make them members of your group with appropriate permissions (u+r--). You may not want all other users to be able to access your files so you don't want to make all users members of your group.

Cool thanks, I was hoping I'd get a good reason. But I didn't like having a group named "toe" so I changed it to "grp_toe" :-D
 
Old 12-04-2008, 10:59 AM   #7
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
What you describe is called User Private Groups and you can find out more information about it at the Red Hat site.
 
Old 12-04-2008, 12:49 PM   #8
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
My speculation

I would assume that such things were started to make things more user friendly. If the umask is defaulted to 007 and the user IS in their own primary group then no other users can view their stuff.

However if they are not in their own primary group with 007 umask, then any user in that user's primary group can view their files.

Just as well... the default umask could always be changed to 077. Then only that user could view files created by that user.

But then... as long as you are the primary owner of the file, you should be able to chmod the permissions to anything you want.


Something else to keep in mind is that group names and usernames mean nothing to the filesystem on the disk. The disk just knows group numbers and user numbers. Your system's /etc/passwd and /etc/group files are what keep track of the names (well of course there is a lot more that goes into all that...)

You will run into this issue if you dual boot linux OS's and when you swap drives and what not.
You will end up with a file owned by 2000:1340 because there is no user or group assigned to those.

In most popular OSs new users will be assigned the first available starting at 500:500 or 1000:1000 and will name them both the same.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 01:14 PM
user and group LinLove Linux - Software 1 11-30-2007 04:59 AM
user ID group ID cad Linux - General 7 02-01-2007 09:36 AM
User and Group Admin: How to tell Who is in What group? Akhran Linux - Newbie 1 11-12-2005 11:16 PM
Who can tell me why? (user and group) shadkong Slackware 5 05-21-2005 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration