"Ghost" connections

I have ghost connections that havent disconnected even tho the users have logged off:

[root@li5-11 root]# who

root pts/47 Sep 17 17:06

irc pts/48 Sep 17 18:45 (4.10.167.86)

root pts/50 Sep 17 19:13 (4.10.167.86)

irc pts/51 Sep 17 19:26

siggo pts/57 Sep 17 20:26

root pts/58 Sep 17 20:30

night pts/61 Sep 17 20:46

root pts/62 Sep 17 20:49

night pts/73 Sep 18 13:41 (acc8c0f9.ipt.aol.com)

root pts/74 Sep 18 15:27 (4.10.167.86)

[root@li5-11 root]#

How the heck do I get rid of them without having to reboot?!?! I have killed all of the processes these ghost connections were running, I have restarted the ssh daemon several times, I have went in and enabled "KeepAlive" and restarted also. They still wont go away.

Any ideas guys?

2 Replies

There is just some rubbish left in /var/run/utmp, where processes have failed to clear up after themselves. Usually this happens if you have had zombies or stuff you had to kill for whatever reason.

To fix without rebooting, log everyone off the machine except for one instance of root. (I tried it on the Linode virtual console, not on a terminal.) and do cat /dev/null > /var/run/utmp

Log out and then log back in again - who will report correct information.

awesome. worked perfectly.

thanks!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct