在进行删除用户时提示:
[[email protected] ~]# userdel user2
userdel: user user2 is currently logged in
在登陆user2 进行login out,exit退出登陆都无法解决后,搜索到解决办法
查阅google
SU to the user su - username
and run kill -9 -1
as the user.
Exit the shell and try the userdel -r username
again.
Or you can check for processes from the user using lsof -u username
and kill the relevant PIDs.
Or pkill -u username
or pkill -u uid
========================================================
su user2
kill -9 -1
user -r user2
成功删除了user2
=======================================
后续知识扩展了补充原理,
时间: 2024-12-28 02:15:08