Chinaunix

标题: 一个文件是-rw-r--r-- 1 root root,怎么用ROOT用户删除不了? [打印本页]

作者: aswjh    时间: 2008-11-11 11:43
标题: 一个文件是-rw-r--r-- 1 root root,怎么用ROOT用户删除不了?
用RM命令后提示:not removed: Permission denied,怎么回事?
作者: lkomn    时间: 2008-11-11 16:04
chmod 777 文件名 然后rm试一下
作者: zhaoqh    时间: 2008-11-11 16:09
whoami
先确定一下你是不是root
作者: easybegin    时间: 2008-11-11 16:13
ls -al 看看是不是属于root
作者: aswjh    时间: 2008-11-11 17:52
是用ROOT用户TELNET过去的,不知是否有影响。
-rw-r--r-- 1 root root就是LS -AL出来的
作者: cdleo    时间: 2008-11-11 18:09
attribute
查下这个参数~
以前遇到过类似问题
怎么处理的不记得了~自力吧~
作者: capricorn1981    时间: 2008-11-12 00:43
没有x 执行权限,chmod 777 还有chown -R root:组名 目录。
改变权限和属主。
作者: briangao    时间: 2008-11-12 08:53
What is the file name that you want to remove? Is it a directory? If it is a mount point, you can't remove it unless you unmount to file system first.
作者: yuhuohu    时间: 2008-11-12 09:01
原帖由 briangao 于 2008-11-12 08:53 发表
What is the file name that you want to remove? Is it a directory? If it is a mount point, you can't remove it unless you unmount to file system first.


老高的思路确实开阔,佩服
作者: aswjh    时间: 2008-11-12 09:56
是以前存档的一个文件,不是目录,
真是怪了
作者: briangao    时间: 2008-11-12 10:33
是以前存档的一个文件,不是目录,
真是怪了
Have you tried force remove,  rm -f filename
Can you post ls -l filename and file filename ?
作者: bloomit    时间: 2008-11-12 13:55
有LDAP等服务?
作者: yulemi    时间: 2008-11-13 10:08
支持7楼的看法,你没X的权利你怎么删啊??
作者: briangao    时间: 2008-11-13 10:17
是以前存档的一个文件,不是目录,
真是怪了
Are you sure? I bet it is a mount point that you want to remove. That is almost the only scenario where root can't remove a directory

[ 本帖最后由 briangao 于 2008-11-12 21:19 编辑 ]
作者: steedz    时间: 2008-11-13 10:27
高手都用英文
作者: free4us    时间: 2008-11-13 10:36
加个执行权限也不行吗?
作者: aswjh    时间: 2008-11-13 12:49
chmod: WARNING: can't change
作者: li_hunter    时间: 2008-11-13 13:13
原帖由 aswjh 于 2008-11-13 12:49 发表
chmod: WARNING: can't change


你用的是Solaris 10吗?如果是的话,请按步骤运行以下的DTrace脚本看看会返回什么errno。

-bash-3.00# cat chmod.d
#!/usr/sbin/dtrace -s
syscall::chmod:return
/arg0 == -1/
{
   printf("errno = %d\n", errno);
}

-bash-3.00# chmod 755 chmod.d
-bash-3.00# ./chmod.d
dtrace: script './chmod.d' matched 1 probe


然后在另外一个session中进行chmod命令操作,请将结果贴出来。要退出前面的DTrace脚本运行,按ctrl-c。
作者: li_hunter    时间: 2008-11-13 13:29
如果errno返回值为13(permission denied),可以看一下该文件所在文件系统的mount option吗?即可否给出相关文件系统mount的输出?如果文件系统为只读,则不能删除是正常的。
作者: briangao    时间: 2008-11-13 21:32
It seems that you wanted to remove a file or a directory inside a NFS mounted directory. If that is the case, you will get permission denied meassge unless you share the source with special permissions for remote root users.
作者: aswjh    时间: 2008-11-14 12:43
可以了。是两个电脑共享一个硬盘,在另外一台电脑上一下就删掉了。
但是不知道为什么这样
作者: peckerwood    时间: 2008-11-16 11:46
晕 没有可执行权限 怎么删除
作者: aswjh    时间: 2008-11-16 11:55
和X没什么关系
作者: flycentos    时间: 2008-11-20 14:29
关注中




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2