向特定用户授予文件访问权限 [英] Granting Access Permission to a file to a specific user

查看:440
本文介绍了向特定用户授予文件访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux中,如何将文件/文件夹的访问权限授予特定的人.换句话说,假设我只允许用户fred读取文件,那我该怎么做?

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?

请注意,我对chmod以及所有内容都很了解,但是Linux似乎并未提供经过微调的访问权限控制,您可以在其中指定一个特定用户的访问控制.

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.

谢谢, 艾莉森

推荐答案

Unix使用自由访问控制(DAC)来获得权限和访问控制.为了获得更好的安全性,SELinux提供了强制访问控制(MAC).对于管理员来说,这被认为很难设置和维护.

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.

使用命令:

chown user_name file
chown user_name folder
chown -R user_name folder #recursive

这篇关于向特定用户授予文件访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆