|
发表于 2004-9-22 22:56:19
|
显示全部楼层
回复: 问:关于chown设置一个文件的权限
最初由 txkss 发表
在root目录下有一个文本文件hello
系统中有一个名为testuser的普通用户
现在这个hello文件的所有者和组都是root
我执行了#chown testuser:root hello
可是不成功啊?
[root@server root]# ls
anaconda-ks.cfg hi install.log.syslog test
hello install.log kernel-ntfs-2.4.18-3.i386.rpm
[root@server root]# chown testuser:root hello
chown: changing ownership of `hello': Operation not permitted
[root@server root]# chown root:testuser hello
chown: changing ownership of `hello': Operation not permitted
[root@server root]#
chown不能指定一个文件的所有者和所有组吗?
改变文件的所有者用chown,改变文件的组用chgrp,如:
/root#ll file
-rw-r--r-- 1 root root 0 9月 22 22:57 file
/root#chown lee file
/root#ll file
-rw-r--r-- 1 lee root 0 9月 22 22:57 file
/root#chgrp lee file
/root#ll file
-rw-r--r-- 1 lee lee 0 9月 22 22:57 file
/root#
ps:我的理解有限,如果还有问题,请看chown,chgrp,chmod等命令的manual. |
|