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

Re: Help! File permissions keep changing...



On Wed, Feb 18, 2004 at 02:15:36AM +0100, Javier Fern?ndez-Sanguino Pe?a wrote:
> On Tue, Feb 17, 2004 at 03:12:44PM -0600, Hhayes wrote:
> > I have a Debian box running as a file server on a network with 50 users. So
> (...)
> > saved the file, resulting in a file that no other users can write to. Has
> > anyone ever seen this before?
> 
> Ejem, yes, it's called UN*X :-)
> You can try to settle it by using umask (as other's have suggested) but 
> users can defeat that. If you _really_ want to fix it, have a cronjob do 
> this (quick and dirty, could be _really_ improved)
> 
> ----------------------------------------------------------
> DIR_TO_FIX=/home/groupX
> GROUP=mygroup
> PERM=g+rwX
> 
> find $DIR_TO_FIX -type f -o -type d | xargs chown $GROUP 
> # or chown -hR $GROUP $DIR_TO_FIX
> find $DIR_TO_FIX -type f -o -type d | xargs chmod $PERM
> # or chmod -hR $PERM $DIR_TO_FIX
> ----------------------------------------------------------
> 
> Run it as frequently as you think it's necessary (daily, hourly, whatever) 
> and forewarn the users that this is programmed (so they do not get confused 
> when they see things changing while they are working with them)

This seems like overkill, since it sounded like he was talking about
using Samba as his file server.

The easiest solution is to tweak these settings in /etc/samba/smb.conf:
; File creation mask is set to 0700 for security reasons. If you want to
;       create files with group=rw permissions, set next parameter to 0775.
   create mask = 0755

; Directory creation mask is set to 0700 for security reasons. If you want to
;       create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0755


-- 
Elie Rosenblum                 That is not dead which can eternal lie,
http://www.cosanostra.net   And with strange aeons even death may die.
Admin / Mercenary / System Programmer             - _The Necronomicon_



Reply to: