首页 > 其他 > 详细

root用户无法修改文件权限(lsattr/chattr: i 和 a 属性含义)

时间:2015-01-19 15:36:04      阅读:228      评论:0      收藏:0      [点我收藏+]

  今天想在实验室分配的服务器上添加一个普通用户, 所以用root身份登录服务器后执行useradd命令,却提示无法读写

/etc/shadow文件; ls -l /etc/shadow发现什么权限都没有,于是就用chmod更改我(root)对/etc/shadow文件的权限,但

让我万万没有想到的是,又提示无法更改该文件的权限,于是到网上查询之后,发现了这个帖子.问题解决了。

  但,i和a属性是什么东西?

  我们可以通过man chattr查看(仅摘录相关部分):

DESCRIPTION: "chattr" changes the file attributes on a Linux second extended file system.

A file with the a attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

A file with the i attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be  written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

 What do ‘a‘ attribute and ‘i‘ attribute mean?

append only (a), immutable (i).

 

root用户无法修改文件权限(lsattr/chattr: i 和 a 属性含义)

原文:http://www.cnblogs.com/lxw0109/p/root_chmod_deny.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!