You are not logged in.

#1 2007-10-04 14:39:14

Ruckus
Member
Registered: 2007-02-17
Posts: 204

A file's Default Group on creation

I have an NFS/Samba share on my server, the share is on an ext3 filesystem. I want all files inside of this share to be owned by a certain group (media) so that all of the users in that group can access the files. As it is now, if i create a file from my arch desktop (NFS), it is owned by my account and the users group. And then people on the samba share or my other computer running arch can't access the file i created without me having to chown it. The only way I can think of to solve this would be to use a script on crontab (doesn't sound very efficient).

Offline

#2 2007-10-04 15:21:28

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: A file's Default Group on creation

Setting the setgid bit on a directory (eg, "chmod g+s /path/to/dir") will cause all files created therein to be owned by the owner of the directory.  New directories created therein will inherit the setgid bit but existing subdirectories will not, so if you have an existing directory structure, use the -R arg to chmod to recursively add the setgid bit.

Offline

#3 2007-10-04 16:19:29

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: A file's Default Group on creation

>> [...] a script on crontab (doesn't sound very efficient).

you could also use incrond. see website and forum search.


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

#4 2007-10-07 03:45:31

Ruckus
Member
Registered: 2007-02-17
Posts: 204

Re: A file's Default Group on creation

tam1138 wrote:

Setting the setgid bit on a directory (eg, "chmod g+s /path/to/dir") will cause all files created therein to be owned by the owner of the directory.  New directories created therein will inherit the setgid bit but existing subdirectories will not, so if you have an existing directory structure, use the -R arg to chmod to recursively add the setgid bit.

Thank you, this seems to be working perfectly.

Offline

Board footer

Powered by FluxBB