在进行删除用户时提示:
[root@localhost ~]# 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
=======================================
后续知识扩展了补充原理,
本文出自 “键心通明” 博客,请务必保留此出处http://loveyp.blog.51cto.com/4450676/1628031
原文地址:http://loveyp.blog.51cto.com/4450676/1628031