[svlug] How do you log users off?

Seth David Schoen schoen at uclink4.berkeley.edu
Sun Nov 22 20:28:18 PST 1998


Hans Cathcart writes:

> Really silly question. I didn't find the answer in "Running Linux" and it's
> not obviously anywhere.
> 
> How do I log a user off and out of my system when they are logged in from a
> root login? (what if they log in with ssh?)

Kill their login shells.  If you become root, you can kill any shell
(including a shell that belongs to root).

> And, if some of my users have broken their connections and are logged out,
> but still appear in "who" what do I do, to clear them?

Ick.  The problem is inconsistent information in /var/run/utmp, and there
is not necessarily a particularly clean way to fix it.

Looking in the utmp man page, you might try

init 1
init 3

This will log out everyone and then allow logins again.  It would, I hope,
have the side effect of "logging out" everyone whom the system falsely
believes to be logged in.  This could be the cleanest way to fix a broken
utmp without a hard reboot.

-- 
   Seth David Schoen L&S '01 (undeclared) / schoen at uclink4.berkeley.edu
He said, "This is what the king who will reign over you will do."  And they
said, "Nay, but we will have a king over us, that we also may be like all the
nations." (1 Sam 8)  http://ishmael.geecs.org/~sigma/   http://www.loyalty.org/

--
echo "unsubscribe svlug" | mail majordomo at svlug.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to unsubscribe
see http://www.svlug.org/mdstuff/lists.shtml for posting guidelines.



More information about the svlug mailing list