Q: How do I log off a user that has forgotten to logout from a shared computer?
A: This example showcases the Gentle logoff-procedure found in the article Log Off Your Kids at http://sjrnet.net/linux_articles/Tip_LogOffKids/LogOffYourKids.shtml.
The procedure assumes RHEL, but should work with any linux-distro, eg CentOS.
Assumptions: Computer Bookable is locked with a passworded screensaver and the user is nowhere to be found. Computer Processor is available for logon.
- Logon to Processor as root.
- Open a terminal.
- Ssh to Bookable as root: ssh root@bookable
- In the terminal window (while ssh:ed on Bookable), enter: ps -ef|grep username|grep saver
- Note the process-id (PID).
- Enter: kill <PID-number>
- Check Bookable, the screensaver should be off now and the users desktop shown.
- Save anything unsaved and close all running programs.
- Log off Bookable.
- Mail the user about not forgetting to logoff the session when done.
Also see Linux Kill and Logout Users.