Re: how to control create permissions in a dir?

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

 



On Tue, 2005-10-25 at 15:58 -0500, Christopher J. Bottaro wrote:
> tlc wrote:
> 
> > On Tue, 2005-10-25 at 14:19 -0500, Christopher J. Bottaro wrote:
> >> I have a dir /home/music which is shared by all my users.  I want every
> >> file created under /home/music to have 666 permissions, no matter who
> >> creates it, and every dir created under /home/music to have 777
> >> permissions, no
> >> matter who creates it.  How do I do this?
> >> 
> >> Thank you for the help.
> >> 
> > are these going to be local users or samba users? If they are smb users
> > you can set that up in the conf file.
> 
> Local users, not samba users.
----
I know of no way to get this done without changing basic behavior.

You could change the default umask for all the users, default umask is
022 which strips the write permission on the files that they save. This
isn't recommended procedure since that means that everyone always writes
files that everyone else can read. If you want to travel down this path,
it's likely bash shell and /etc/bashrc sets it but I wouldn't go there.

Two other options - have a cron script automatically set permissions
recursively every 10 minutes or so...

# cat /root/set_music_permissions
#!/bin/sh
#
chmod -R g+w,o+w /home/music

make sure this is executable (only)
chmod 700 /root/set_music_permissions

then edit cron...

crontab -e
60/12 * * * * /root/set_music_permissions 2>&1

this would change the permissions every 5 minutes (I think, I use cron
to infrequently to keep it straight), adjust as desired.

The last option, probably the one I like least but may be popular...is
to export the directory via samba and mount the samba share whereby, as
the previous questioner was trying to get at...would allow you to set
the mask directly via samba...force create/force directory but that is
tacky. 

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux