Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting default filesystem permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
RaraRasputin
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2004
Posts: 142
Location: Germany

PostPosted: Fri Aug 20, 2010 11:05 am    Post subject: Setting default filesystem permissions Reply with quote

Hi folks,

how do I set default permissions for new files created by a user in a specific location? And how do I force a specific group for files in a specific location?

For example the home directory should be accessible only by the owner, a data-mount should be read/write by owner and by group, and the group on new or copied files shall be set to "share-access"?

-Rasputin
_________________
RaraRasputin, lover of the Russian Queen
Back to top
View user's profile Send private message
msalerno
Veteran
Veteran


Joined: 17 Dec 2002
Posts: 1338
Location: Sweating in South Florida

PostPosted: Fri Aug 20, 2010 1:36 pm    Post subject: Reply with quote

how do I force a specific group for files in a specific location?

Quote:
setuid and setgid on directories

The setuid and setgid flags, when set on a directory, have an entirely different meaning.

Setting the setgid permission on a directory (chmod g+s) causes new files and subdirectories created within it to inherit its groupID, rather than the primary groupID of the user who created the file (the ownerID is never affected, only the groupID). Newly created subdirectories inherit the setgid bit. Note that setting the setgid permission on a directory only affects the groupID of new files and subdirectories created after the setgid bit is set, and is not applied to existing entities. Setting the setgid bit on existing subdirectories must be done manually.


I don't know of a way to set default permissions per directory, the best I can come up with is setting the umask.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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