root用户无法修改文件权限(lsattr/chattr: i 和 a 属性含义)
2015-01-19 15:29
741 查看
今天想在实验室分配的服务器上添加一个普通用户, 所以用root身份登录服务器后执行useradd命令,却提示无法读写
/etc/shadow文件; ls -l /etc/shadow发现什么权限都没有,于是就用chmod更改我(root)对/etc/shadow文件的权限,但
让我万万没有想到的是,又提示无法更改该文件的权限,于是到网上查询之后,发现了这个帖子.问题解决了。
但,i和a属性是什么东西?
我们可以通过man chattr查看(仅摘录相关部分):
What do 'a' attribute and 'i' attribute mean?
补充:
linux三个特殊权限setuid、setgid和stick bit使用详解
/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).
补充:
linux三个特殊权限setuid、setgid和stick bit使用详解
相关文章推荐
- linux命令详解(19)修改文件属性lsattr、chattr命令详解
- MySQL命令行 不同端口登录 执行SQL文件 创建用户 赋予权限 修改root密码
- MySQL命令行 不同端口登录 执行SQL文件 创建用户 赋予权限 修改root密码
- 无法打开锁文件 /var/lib/dpkg/lock - open (13: 权限不够) 无法对状态列表目录加锁(/var/lib/dpkg/),请查看您是否正以 root 用户运行?
- 用cmd命令修改文件属性,让用户没有权限操作或隐藏文件
- ubuntu下修改进入root用户和修改文件权限
- Linux下修改文件属性 —— chattr和lsattr命令介绍
- 鸟哥私房菜《第七章文件权限》文件无法修改与文件锁定命令chattr, lsattr
- 2周第3次课 文件或目录权限chmod 更改文件所有者和所属组chown umask掩码 文件特殊属性chattr_lsattr
- linux文件无法删除-rw-r--r-- (用lsattr chattr设置特殊属性)
- 如何实现Windows系统Users组用户可修改IP属性和限制Users组用户访问文件的权限!
- <四>Linux文件权限与属性详解--chattr & lsattr
- Linux 文件隐藏属性和特殊权限 —— chattr/ lsattr 和 SUID/SGID/SBIT
- root用户修改文件(chown,chmod)提示没有权限
- linux命令详解(19)修改文件属性 lsattr、chattr命令详解
- MySQL命令行 不同端口登录 执行SQL文件 创建用户 赋予权限 修改root密码
- centos 特殊权限 各种搜索命令 lsattr ,chattr,suid,sgid,sbit,file,type是否是内置命令,stat文件属性 ,whereis,locate,find,ln 内部命令和外部命令 第五节课
- 怎么让普通用户达到root用户也可以拥有权限修改文件(CentOS系统)
- 修改.bashrc文件错误导致root无法登录的解决办法
- ylmf OS 3.0 分配修改登陆root用户管理权限的方法