Linux 向特定用户授予对文件的访问权限
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9355625/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Granting Access Permission to a file to a specific user
提问by Alison Lee
In linux, how can I give access permissions to a file/folder to a specific person. In other words suppose I want to allow only and only user fred to be able to read a file, then how do I do that?
在 linux 中,如何将文件/文件夹的访问权限授予特定人员。换句话说,假设我只想允许且只有用户 fred 能够读取文件,那么我该怎么做?
Note that I know about chmod and all, but Linux doesn't seem to provide a fine tuned access permission control where you can specify the access control of one specific user.
请注意,我知道 chmod 和所有内容,但 Linux 似乎没有提供微调的访问权限控制,您可以在其中指定一个特定用户的访问控制。
Thanks, Alison
谢谢,艾莉森
采纳答案by Daniel
Unix uses discretionary access control (DAC) for permissions and access control. For better security SELinux provide mandatory access control (MAC). This is consider difficult for administrators to set up and maintain.
Unix 使用自由访问控制 (DAC) 进行权限和访问控制。为了更好的安全性,SELinux 提供强制访问控制 (MAC)。这对于管理员来说很难设置和维护。
Use commands:
使用命令:
chown user_name file
chown user_name folder
chown -R user_name folder #recursive