个人工具

沙盒

来自Ubuntu中文

Jinzd讨论 | 贡献2016年6月8日 (三) 14:32的版本

跳转至: 导航, 搜索

为了分享同一目录的多用户写入权限,把该目录的写入权限授予一个分组是必要的。下面的例子把/var/www/html目录的写入权限授予"webmasters"分组。

sudo chgrp -R webmasters /var/www/html
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www/html -type f -exec chmod g=rw  "{}" \;

These commands recursively set the group permission on all files and directories in /var/www/html to read write and set user id. This has the effect of having the files and directories inherit their group and permission from their parrent. Many admins find this useful for allowing multiple users to edit files in a directory tree.

If access must be granted to more than one group per directory, enable Access Control Lists (ACLs).