|
|
(未显示5个用户的118个中间版本) |
第1行: |
第1行: |
− | 为了分享同一目录的多用户写入权限,把该目录的写入权限授予一个分组是必要的。下面的例子把/var/www/html目录的写入权限授予"webmasters"分组。
| + | [[文件:14.png]] |
− | | + | |
− | <pre>
| + | |
− | 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 "{}" \;
| + | |
− | </pre>
| + | |
− | | + | |
− | 这些命令递归地设置组权限到/var/www/html下的所有文件和目录,以保证该组用户对该目录的读写权限。也就是说,该目录下的文件和目录将从它们的父亲继承相应的组权限。很多管理员发现这对多用户编辑同一目录树非常有效。
| + | |
− | | + | |
− | : <span style="background-color: lightgray">If access must be granted to more than one group per directory, enable Access Control Lists (ACLs). </span> | + | |