I have a directory called "music" and two groups: music, singers.
I executed
chgrp music music
I am looking to grant read and write access to the /music directory for the singers group, but I don't want to change the ownership.
Is this possible?
I am a bit confused with chown and chgrp. I believe chown changes ownership for a single user and not a group? and chgrp changes the group?
Is there a way to set group ownership, but grant permissions to one other specified group?
There is no way to do this using traditional permissions, but it can be done using the getfacl
and setfacl
commands (typically available via the acl
package).
getfacl
allows you to read the ACL entries for a directory or file.
setfacl
allows changing the ACL entries for a directory or file.
In your example, you would want to run something like the following commands:
setfacl -m g:music:rwx /path/to/music
setfacl -m g:singers:rwx /path/to/music
-m
to modify
, g
to modify the group ACL(s), music
and singers
the group name, rwx
the traditional permissions you want applied, /path/to/music
the path to the directory you want to modify ACLs for.
To make this apply by default to any new files/directories created within the music folder, you want to add the -d
flag for default
, and to apply recursively to all existing files/directories, you want to add the -R
flag for recursive
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments