![](/img/trans.png)
[英]linux how to allow user to read/write/delete files created from root in a specific folder
[英]Give a specific user permissions to a specific folder from root
我想授予特定用户对特定文件夹的权限,在 Linux 中具有不同级别的权限(读取、写入、执行)。 并为某些群体做同样的事情。
例如我想给用户: promotional_material
的sigmundlucas
权限(读、写)
另一个例子是我想给组: testers
permissions (execute) for development_project_data_directory
我需要从 root 帐户执行所有这些操作,因为有问题的文件夹在登录用户时不允许使用chmod
我需要添加多个组/用户需要访问一些文件
这通常是通过chown
和 groups 来完成的!
为您的用户创建一些组作为其成员
然后将目录chown
为:<group>
例如
groupadd mygroup # create a new group
usermod -aG mygroup myuser # add the group to the user's info
chown :mygroup target_directory # set the group to own the directory
chmod 770 target_directory # root and the group can enter/read/write
如果您不习惯这些数字,您可以使用https://chmod-calculator.com/ 之类的网站计算 chmod
陷阱
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.