Idiots' guide to file permissions for new files

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Idiots' guide to file permissions for new files

Postby cmcevoy » Mon Dec 10, 2012 11:28 pm

I have several users. All belong to group 'users' and some to group 'adults'
There are two directories:
'Shared' is owned by :users, directory permissions 777, files 664
'Secure' is owned by :adults, directory permissions 770, files 660

All I want is for new files and subdirectories to follow this stucture. I've failed using GUID and failed using ACLs although I suspect that is the solution really.
Running 'find <...> | xargs chmod' every so often works, but surely there is a better way?

I'll provide the idiot if you provide the guide?
Thanks
cmcevoy
 
Posts: 70
Joined: Wed Nov 30, 2005 4:06 pm
Location: Ripon, UK

Postby nelz » Tue Dec 11, 2012 12:03 am

Default permissions for new files and directories follow the umask setting, but this is set per filesystem rather than per directory.

You really should be persevering with ACLs, this is exactly the type of situation they deal with. Rather than trying to re-invent the wheel, and probably ending up with a square one, it would be better to look at why ACLs don't do what you want.

Like most other software, setfacl does what you tell it to, not what you want it to, so post what you want, what you tried and what you actually got.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8494
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby cmcevoy » Tue Dec 11, 2012 9:42 am

Thanks. I think I'd ended up with too many ACLs set, but since you confirmed I was on the right track I cleared them all then reset
Code: Select all
setfacl -m d:g:users:rwx Shared
setfacl -m d:g:adults:rwx Secure
setfacl -m d:o:x Secure

and this seems to give what I want. Thanks for your encouragement.
cmcevoy
 
Posts: 70
Joined: Wed Nov 30, 2005 4:06 pm
Location: Ripon, UK


Return to Help!

Who is online

Users browsing this forum: No registered users and 2 guests