1820095 Members
3488 Online
109608 Solutions
New Discussion юеВ

Default directory acls

 
SOLVED
Go to solution

Default directory acls

I wonder if it's possible with default acls to arrange a situation that whatever group creates a file under a certain directory, the new file would have always the same group name.
The default directory acl then would look like this:
default:user::rwx
default:group:defaultgroupname:rw-
default:mask::rw-
default:other::rw-

Thanks for your input,
Philippe
5 REPLIES 5
Vipulinux
Respected Contributor

Re: Default directory acls

Hi

In order to have the same ownership for every file under a directory do this:

chown -R user:group /dir

here specify the group you want to have the ownership on the dir and the files under it. (new and existing)

then do
chmod -R 755 /dir

Cheers
Ivan Ferreira
Honored Contributor
Solution

Re: Default directory acls

To do this:

"the new file would have always the same group name"

Enable the SGID bit on the directory:

chmod g+s /path/to/directory
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?

Re: Default directory acls

Ivan,
Thanks, this is what I was looking for. I didn't know this trick !!

Vipulinux,
For your suggestion to work, it should have been chmod 2775 /dir , which is then essentially the same as Ivan's answer.
Thanks anyhow.

Philippe
Vipulinux
Respected Contributor

Re: Default directory acls

Hi
Thanks for pointing that out

Cheers
Muthukumar_5
Honored Contributor

Re: Default directory acls

chmod g+s
chmod 2775

is same. View the permission as,

ls -ld

see man chmod.

--
Muthu
Easy to suggest when don't know about the problem!