删除用户时出现问题

删除用户时出现问题

我在 Ubuntu 终端上删除用户时遇到问题。我以 root 身份登录并输入:

# deluser mn1 
userdel: user mn1 is currently used by process 21106
/usr/sbin/deluser: `/usr/sbin/userdel mn1' returned error code 8. Exiting.

但我之后得到了同样的错误:

# kill 21106
# deluser mn1

所以我看看发生了什么top -u mn1,然后我得到了:

21106 mn1       20   0   24772      0      0 S  0.0  0.0   0:00.02 bash

该怎么办?

答案1

如果默认kill命令不起作用,请尝试使用-9选项 (as root):

sudo kill -9 21106

更多信息kill请参见:人殺

-9选项意味着SIGKILL(见下表,摘自人信号了解详情)

Signal     Value     Action   Comment
──────────────────────────────────────────────────────────────────────
SIGHUP        1       Term    Hangup detected on controlling terminal
                              or death of controlling process
SIGINT        2       Term    Interrupt from keyboard
SIGQUIT       3       Core    Quit from keyboard
SIGILL        4       Core    Illegal Instruction
SIGABRT       6       Core    Abort signal from abort(3)
SIGFPE        8       Core    Floating point exception
SIGKILL       9       Term    Kill signal

相关内容