Force user logout?

Kurt Granroth plug-discuss at granroth.org
Sat Feb 18 22:59:31 MST 2006


On Feb 18, 2006, at 10:40 PM, Alan Dayley wrote:
> Let's say a user logged into a computer and set the screen saver
> password (My son did this against house rules to keep his siblings off
> the computer).  This user is no longer available (He is now in  
> bed).  I
> don't know his password but I know the root password for the  
> machine (Of
> course!).  I want to force the user to logout so the machine can  
> cleanly
> shutdown.
>
> Google provides many answers and I haven't found the clear one yet.
> Logged in as root on another console, how do I force a clean logout on
> the (now sleeping) user?

I suppose that depends on your definition of "clean" :-)

# su <user>
$ kill -9 -1

If you want the processes to actually perform a logout procedure and  
your son is running KDE, then try this:

# dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0

Kurt


More information about the PLUG-discuss mailing list