how to kill the tty in unix

前端 未结 10 1528
遇见更好的自我
遇见更好的自我 2020-12-23 20:52

This is the result of the finger command (Today(Monday) when I (Vidya) logged in)

sekic1083 [6:14am] [/home/vidya] -> finger
Name        Tty          


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-23 21:57

    I had the same problem today. I had NO remaining processes, but the remaining finger entry of user "xxx", which prevent me the deletion of this user using "userdel xxx".

    Error message was: userdel: account `xxx' is currently in use.

    It looked like a crashed terminal session. So I rebooted, but the issue remained.

    last xxx
    xxx      pts/5        10.1.2.3     Fri Feb  7 10:25 - crash  (01:27)
    

    So I (re)moved the /var/run/utmp file:

    mv /var/run/utmp /var/run/utmp.save ; touch /var/run/utmp
    

    This cleared all finger entries. Unfortunately in this way even the current running sessions will be cleared. If this is an issue for you, you have to reboot, after you (re)moved the utmp file.

    However in my case this was the solution. Afterwards I was able to successfully delete the user, using "userdel xxx".

提交回复
热议问题