Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Idiots' guide to file permissions for new files

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
cmcevoy



Joined: Wed Nov 30, 2005 4:06 pm
Posts: 70
Location: Ripon, UK

PostPosted: Mon Dec 10, 2012 11:28 pm    Post subject: Idiots' guide to file permissions for new files Reply with quote

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
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8464
Location: Warrington, UK

PostPosted: Tue Dec 11, 2012 12:03 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
cmcevoy



Joined: Wed Nov 30, 2005 4:06 pm
Posts: 70
Location: Ripon, UK

PostPosted: Tue Dec 11, 2012 9:42 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast