LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1248|回复: 12

登录一个系统,root也不能更改文件权限[基本解决]

[复制链接]
发表于 2004-4-16 14:12:59 | 显示全部楼层 |阅读模式
以root通过ssh远程登录以后,
chmod 777 file
提示:
chmod: changing permissions of `iptables': Operation not permitted
怎么回事呢?没有这个命令么?
发表于 2004-4-16 14:17:21 | 显示全部楼层
用lsattr file,列出这个文件的属性(这个文件或许是设置了某些属性,)

chattr -i -a file
试试看
 楼主| 发表于 2004-4-16 14:21:06 | 显示全部楼层
谢谢,搞定了
lsattr file
--------i---------- files
不知道这个i是什么意思。chattr -i file
然后可以执行了,改完以后我将它:chattr +i file
这样是不是恢复原样了?
发表于 2004-4-16 14:27:27 | 显示全部楼层
最初由 风筝 发表
谢谢,搞定了
lsattr file
--------i---------- files
不知道这个i是什么意思。chattr -i file
然后可以执行了,改完以后我将它:chattr +i file
这样是不是恢复原样了?

是不是恢复鸳鸯,自己试试喽~~~
man chattr
...
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  can  set  or  clear this
       attribute.
...

大概意思是说如果一个文件被设置了i属性,那么这个文件不能删除,不能修改,不能被改名,不能被用于链接....只有root可以设置或清楚这个属性
这是出于对文件的安全需要!
 楼主| 发表于 2004-4-16 14:46:12 | 显示全部楼层
看来是恢复了,加i以后,又无法修改了。以前不知道有chattr这个命令,又学了一招,:)
 楼主| 发表于 2004-4-16 14:50:10 | 显示全部楼层
想不到java兄老江湖了居然还在用拼音,呵呵,五笔多快。
发表于 2004-4-16 15:43:16 | 显示全部楼层
最初由 风筝 发表
想不到java兄老江湖了居然还在用拼音,呵呵,五笔多快。

真的么?,我爱用全拼
发表于 2004-4-17 16:38:30 | 显示全部楼层
最初由 javalee 发表
quote:

man chattr
...
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 can set or clear this
attribute.
...

大概意思是说如果一个文件被设置了i属性,那么这个文件不能删除,不能修改,不能被改名,不能被用于链接....只有root可以设置或清楚这个属性
这是出于对文件的安全需要!

在reiserfs下好象不行吧?
发表于 2004-4-17 16:54:53 | 显示全部楼层
最初由 Hauser 发表
在reiserfs下好象不行吧?

我想,在reiserfs下一样会有相应的工具的~,;)
发表于 2004-4-17 16:58:26 | 显示全部楼层
最初由 javalee 发表
我想,在reiserfs下一样会有相应的工具的~,;)

知道的话别忘了告诉我哦!;)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表