SLUG Mailing List Archives
Re: [SLUG] mkdir
- To: Glen Turner <gdt@xxxxxxxxx>
- Subject: Re: [SLUG] mkdir
- From: Matthew Hannigan <mlh@xxxxxxxxxx>
- Date: Fri, 17 Feb 2012 09:12:37 +1100
- Cc: slug@xxxxxxxxxxx
- User-agent: Mutt/1.5.21 (2010-09-15)
Grant Street <grants@xxxxxxxxx> gave the answer previously,
chmod 2755 topdir
which sets the setgid (the 2) and relaxed perms (the 755)
But this didnt fix the existing dirs group ownership.
Also you might want 775 instead of 755.
See below for my take.
On Wed, Feb 15, 2012 at 08:44:41PM +1030, Glen Turner wrote:
[ .. ]
> directory -- search for "sticky bit on directory". Even that might not
not sticky bit, setgid bit (common mistake)
> give the group access, it depends on the user's umask.
The better couple of invocations are:
chmod g+s topdir # set topdir setgid bit so group ownership is preserved
chgrp -hR SOMEGRP topdir # repair group of existing files and dirs
chmod -R g+rwX,o+rX topdir # to repair permissions for existing files and dirs
I tend to use symbolic rather than octal,
tends to be easier to remember and more precise/accurate.
PS. exercise for the reader , find out what the -h and the capital X do