无法在CentOS上删除用户目录 [英] Can't delete user directory on CentOS

查看:281
本文介绍了无法在CentOS上删除用户目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我卡住了。



我做了一个简单的useradd。我有用户 - >标记和分配目录 - > / home / mark。这里我安装了一个软件。后来我删除了标记,现在我不能删除/ home / mark。使用root帐户尝试:



a)将权限更改为777 - >权限被拒绝



目录

  rm -rf / home / mark 

权限被拒绝



c)Nautilus

  sudo nautilus 

无法解析参数:无法打开显示?)



我无法从我的服务器中删除此目录。这是我的权限列表

  ls -la / home / mark 

drwx ------ 5 502 502 4096 10小时前13:32。
drwxr-xr-x 5 root root 4096 10年前16:13 ..
-rwxrwxrwx 1 502 502 366 10小时前13:46 .bash_history
-rwxrwxrwx 1 502 502 18 10 mag 20 :45 .bash_logout
-rwxrwxrwx 1 502 502 176 10 mag 20:45 .bash_profile
-rwxrwxrwx 1 502 502 124 10 mag 20:45 .bashrc
drwxrwxrwx 2 502 502 4096 12 nov 2010 .gnome2
drwxrwxrwx 2 502 502 4096 10小时前14:28 .mozilla
drwxrwxrwx 2 502 502 4096 10小时前14:28 mypackage
-rwxrwxrwx 1 502 502 4131518 10小时前05:06 mypackage。任何想法?

 
ps在GNOME上,当我右键单击此文件夹(当然,我无法打开它)我看到在权限选项卡上,所有者和组仍然被分配到标记的ID。我可以看到所有者 - > 502 - 用户#502(它是标记)和组 - > 502。所有形式都是灰色的,我不能编辑它们。

解决方案

要以root身份删除用户标记及其数据(/ hom / mark),请输入:

 code> #userdel -r mark 

编辑:尝试此

  chattr -i mark 
rm -rf mark

你说你不能 chown 这个目录,如果上面的命令不工作,我建议 fsck 在系统上:

  #shutdown -r -F now 

检查filesyetemn以删除标记文件夹后尝试。


I'm stuck.

I did a simple useradd. I had user -> mark and assigned directory -> /home/mark. Here i've installed a software. Later I've deleted mark and now i can't delete /home/mark. With root account I tried to:

a) Change permission to 777 -> Permission denied

b) Delete directory with

rm -rf /home/mark

Permission denied

c) Nautilus

sudo nautilus 

Could not parse arguments: Can't open display (what??)

There's no way for me to remove this directory from my server. Here's my permissions list

ls -la /home/mark

drwx------ 5  502  502    4096 10 ago 13:32 .
drwxr-xr-x 5 root root    4096 10 ago 16:13 ..
-rwxrwxrwx 1  502  502     366 10 ago 13:46 .bash_history
-rwxrwxrwx 1  502  502      18 10 mag 20:45 .bash_logout
-rwxrwxrwx 1  502  502     176 10 mag 20:45 .bash_profile
-rwxrwxrwx 1  502  502     124 10 mag 20:45 .bashrc
drwxrwxrwx 2  502  502    4096 12 nov  2010 .gnome2
drwxrwxrwx 2  502  502    4096 10 ago 14:28 .mozilla
drwxrwxrwx 2  502  502    4096 10 ago 14:28 mypackage
-rwxrwxrwx 1  502  502 4131518 10 ago 05:06 mypackage.tar.gz

Any idea?

p.s. On GNOME when I right-click this folder (of course I can't open it) I see on Permissions tab that Owner and Group are still assigned to mark's ID. I can see Owner -> 502 - user #502 (it was mark) and Group -> 502. All forms are greyed-out and I can't edit them.

解决方案

To delete the user mark and his data (/hom/mark), as root type this:

#userdel -r mark

EDIT : try this

chattr -i mark
rm -rf mark

You said that you cannot chown this directory, if the command above does not work, i suggest fsck on the system:

#shutdown -r -F now

And try after checking the filesyetemn to remove the mark folder.

这篇关于无法在CentOS上删除用户目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆