# add more than a group to permission of files



## armix (Apr 4, 2018)

Hello everybody,

I would like to know, how can I set permission for different groups in FreeBSD?

here I show a example:

```
----rwx---  1 root  armix  9 Apr  4 14:43 hello.txt
```
but here I can't add or see other groups!


----------



## SirDice (Apr 4, 2018)

Standard UNIX permissions don't allow more. A file or directory can only have one owner and one group. If you need more complex access control you need to use ACLs. See setfacl(1) and getfacl(1).

Handbook: 13.9. Access Control Lists


----------



## obsigna (Apr 5, 2018)

Instead of using ACLs, I would join all the members of the groups for which I want to set permissions into one supergroup, and then use this group for the respective permissions. For example, as user root:

`pw groupshow groupA`
groupA:*:1001:userA,userB,userC

`pw groupshow groupB`
groupB:*:1002:userD,userE,userF

`pw groupshow groupC`
groupC:*:1003:userG,userH,userI

`pw groupadd -n groupABC -g 2001 -M userA,userB,userC,userD,userE,userF,userG,userH,userI`
`chgrp groupABC hello.txt`


----------

