Richard Freeman on 28 Apr 2010 12:04:03 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Some musings on shell scripts and Linux admin 101

On 04/28/2010 10:53 AM, Mike Leone wrote:
> When you create a user in Linux, they all seem to get a "primary group"
> of their very own. For example, if I create user Mike, the primary group
> is Mike. No one else is in that group; it's just me. I can add Mike to
> other groups, however.

That varies considerably by distro.  What you describe is what I've seen 
called the user-group approach.

The advantage of this approach is that you can set a umask of 0007 
instead of 0077, so that groups have read/write access to files by 
default.  Then for group-related directories you can set the setgid bit 
on the directory so that files created inside it inherit the group, and 
since everybody has a umask of 007 their files are accessible by the 
whole group.

If you put all your users in a single primary group called users or 
something like that, then you will probably set a umask of 0077, which 
means that in a shared directory users will need to remember to reset 
their umask or manually manage permissions (or you can use cron jobs/etc 
to micromanage permissions).

I just wanted to clarify what was likely the thinking of whoever created 
the defaults of your distro.  Both approaches have pros and cons.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --