l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2006 Dec 11 21:44

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] specify umask for a folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] specify umask for a folder?

On Sun, Dec 10, 2006 at 04:50:56PM -0800, Jonathan Stickel wrote:
> I would like to share a group of folders and files with someone else. 
> Our default group is the same.  If we both set our umask (e.g. in 
> ~/.bashrc) to 002, then any file either of us creates can be modified or 
> deleted by the other, or anyone else in our default group.  This is the 
> behavior I want.  However this applies to all files we create anywhere 
> in the local filesystem(s).  Is there a way to set umask locally to a 
> folder and it's subfolders?

First, make sure the default group is different for everyone (ie, same
as their username).  That way, any file they create won't be rwx for
everyone, even if their umask is 002.  Also, go ahead and do set their
umask to be 002.

In the folder you want everyone to share (ie, /mnt/shared), set the
group to be the shared group for everyone (ie, "shgrp").  Additionally,
set the group's sticky bit on the folder and the subfolders.  Like this:

   $ find /mnt/shared -exec chgrp shgrp \{\} \;
   $ find /mnt/shared -type d -exec chmod g+s \{\} \;

When you create a file in a directory with its group sticky bit set, the
file's default group becomes identical to the directory's group.  When
you create a subdirectory in a directory with its group sticky bit set,
the subdirectory's default gropu becomes identical to the directory's
group *and* its group sticky bit gets set as well.

FYI, I noticed winscp ignores the umask and the above "group sticky
rules" when it transfers files from windows to linux.


vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!