# Directory Permissions



## kjemison (Sep 21, 2011)

Hello,

I have created a directory called /data. I created a user called "backup" and gave ownership of the /data directory to backup; backup is a member of the wheel group

I chmod the /data directory for the group to rwx   -   *chmod g=rwx /data*

My issue is this: any previously entered directory will show the permissions change. But, if I create a new directory under the /data directory... the permissions are only rw instead of the rwx that I want.

I know I am just not remembering the simple switch to do this.

A little help would be appreciated.
Thank you
Kell


----------



## swallowtail_butterfly (Sep 21, 2011)

umask(2)? Try
`$ umask 002; mkdir foo`


----------



## fluca1978 (Sep 21, 2011)

Even a set-group-id flag on the directory will perform the trick:


```
chmod g+s /data
```

and all file created under the directory will have the same group as the directory itself.


----------



## kjemison (Sep 21, 2011)

Thank you


----------

