Adding group permission to directory without changing group ownership?

Mindy

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?

Jason Rush

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

changing ownership of file as group user

From Dev

Changing group ownership of files - User management

From Dev

Permanently changing the ownership (or group) of LVM volume

From Dev

Can't change permission/ownership/group of external hard drive on Ubuntu

From Dev

Changing ownership of a directory

From Dev

Patch without changing owner and group

From Dev

Patch without changing owner and group

From Dev

creating a directory tree on a remote machine with a specific group ownership

From Dev

Effective group permission of a directory - setgid ineffective

From Dev

Not able to write to directory despite correct permission and group

From Dev

Group ownership in linux

From Dev

adding FTP user without changing owner of directory?

From Dev

Give permission to a specific group without owning it

From Dev

adding users to group in IBM Directory server (LDAP)

From Dev

Changing ownership without the sudo command

From Dev

Group data without changing query flow

From Dev

No permission to create sub directory when user belongs to directory group

From Dev

ownership permission is automatically changing to root for /var/www/

From Dev

Docker is changing files ownership and permission, why?

From Dev

Change ownership of a large group of files

From Dev

Cannot write to Hadoop DFS directory mode 775 group permission UserGroupInformation

From Dev

Granting permission for all users in a group to write to a directory and all its subdirectories

From Dev

How to enforce group-writable permission for whole directory tree?

From Dev

Can not access directory even i set permission to the group

From Dev

Why does the group need --x permission on the parent directory?

From Dev

Vagrant up error, changing ownership of /vagrant: not a directory

From Dev

SQL group by without group

From Dev

Linux: changing file ownership without a copy?

From Dev

Give user access to folder without changing ownership?

Related Related

  1. 1

    changing ownership of file as group user

  2. 2

    Changing group ownership of files - User management

  3. 3

    Permanently changing the ownership (or group) of LVM volume

  4. 4

    Can't change permission/ownership/group of external hard drive on Ubuntu

  5. 5

    Changing ownership of a directory

  6. 6

    Patch without changing owner and group

  7. 7

    Patch without changing owner and group

  8. 8

    creating a directory tree on a remote machine with a specific group ownership

  9. 9

    Effective group permission of a directory - setgid ineffective

  10. 10

    Not able to write to directory despite correct permission and group

  11. 11

    Group ownership in linux

  12. 12

    adding FTP user without changing owner of directory?

  13. 13

    Give permission to a specific group without owning it

  14. 14

    adding users to group in IBM Directory server (LDAP)

  15. 15

    Changing ownership without the sudo command

  16. 16

    Group data without changing query flow

  17. 17

    No permission to create sub directory when user belongs to directory group

  18. 18

    ownership permission is automatically changing to root for /var/www/

  19. 19

    Docker is changing files ownership and permission, why?

  20. 20

    Change ownership of a large group of files

  21. 21

    Cannot write to Hadoop DFS directory mode 775 group permission UserGroupInformation

  22. 22

    Granting permission for all users in a group to write to a directory and all its subdirectories

  23. 23

    How to enforce group-writable permission for whole directory tree?

  24. 24

    Can not access directory even i set permission to the group

  25. 25

    Why does the group need --x permission on the parent directory?

  26. 26

    Vagrant up error, changing ownership of /vagrant: not a directory

  27. 27

    SQL group by without group

  28. 28

    Linux: changing file ownership without a copy?

  29. 29

    Give user access to folder without changing ownership?

HotTag

Archive