报错——userdel: user hhh is currently used by process 9218


报错 userdel: user hhh is currently used by process 9218

[root@centos71 ~]# useradd   hhh
[root@centos71 ~]# id  hhh
uid=1021(hhh) gid=1021(hhh) groups=1021(hhh)
[root@centos71 ~]# userdel -r  hhh
userdel: user hhh is currently used by process 9218
[root@centos71 ~]# ps -ef | grep  9218
hhh        9218   9217  0 17:36 pts/0    00:00:00 -bash
root       9247   8332  0 17:37 pts/3    00:00:00 grep --color=auto 9218

使用pkill无法杀死

[root@centos71 ~]# pkill  9218
[root@centos71 ~]# ps -ef | grep  9218
hhh        9218   9217  0 17:36 pts/0    00:00:00 -bash
root       9253   8332  0 17:39 pts/3    00:00:00 grep --color=auto 9218
[root@centos71 ~]# ps -ef | grep  9218
hhh        9218   9217  0 17:36 pts/0    00:00:00 -bash
root       9255   8332  0 17:40 pts/3    00:00:00 grep --color=auto 9218
[root@centos71 ~]# id  hhh
uid=1021(hhh) gid=1021(hhh) groups=1021(hhh)

强制杀死

[root@centos71 ~]# kill -9   9218
[root@centos71 ~]# userdel -r  hhh
[root@centos71 ~]# id  hhh
id: hhh: no such user
原文地址:https://www.cnblogs.com/wang618/p/12018245.html