How to make files in Linux folder with default group write permission
I have the folder called backups. The root is putting backups in that folde开发者_如何学Gor. I want that all the files which are created in that folder should have group write permission.
I know i can use umask but i want to know that will umask work for all the files any where or it will work on particular folder.
e,g i want umask for only /backups folder not any where else
One possibility is to use access control lists. The filesystem containing /backups
needs to be mounted with the acl
option. Then give access to the group that should have it:
setfacl -d -Rm group:backup-group:rwx /backups
setfacl -Rm group:backup-group:rwx /backups
All subsequently created files and directories under /backups
will be writable by backup-group
, unless the backup program explicitly uses restrictive permissions (if it's storing archive files of some kind, you'll be ok, but if it's e.g. rsync
preserving permissions, that won't do).
Another possibiliyt is to use bindfs to provide a view of /backups
(mounted at a different location) with different permissions.
精彩评论