沙盒:修订间差异
来自Ubuntu中文
跳到导航跳到搜索
小无编辑摘要 |
小无编辑摘要 |
||
第1行: | 第1行: | ||
For more than one user to be able to write to the same directory it will be necessary to grant write permission to a group they share in common. The following example grants shared write permission to /var/www/html to the group "webmasters". | |||
<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> | |||
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. | |||
: <span style="background-color: lightgray">If access must be granted to more than one group per directory, enable Access Control Lists (ACLs). </span> | |||
: <span style="background-color:lightgray"> | |||
2016年6月8日 (三) 14:27的版本
For more than one user to be able to write to the same directory it will be necessary to grant write permission to a group they share in common. The following example grants shared write permission to /var/www/html to the group "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).