Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 06-28-2007, 08:35 PM   #1
Registered: May 2006
Posts: 77

Rep: Reputation: 15
Command to log a user out? Or restart X within a script?

I've got a system that needs to work as a thin client. I've got it booting up into a remote desktop session, and I'd like it to log the user out of the local machine once the remote session closes. I can't seem to find a way to do that in my script. Has anybody ever made this work?

Right now the machine is running KDE on Fedora Core 5. I'll be running this script in my .kde/Autostart folder, so if it works this could be converted into an EXTREMELY geeky April Fool's joke for next year.
Old 06-29-2007, 03:05 PM   #2
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
pkill -KILL -u username

That might do what you are looking for.. username being the user you wish to log out. you can get a list of logged in users using the who command


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log off a user from command line raazman Linux - General 3 05-11-2007 08:43 PM
Shell script trap and log out a user fmcauley Programming 6 03-06-2007 11:10 PM
user log in and autoruns script rharris72 Programming 1 11-21-2005 10:14 AM
how to log user commands in xterm without using "script" command lilachb Linux - General 2 08-28-2005 02:08 AM
How can i get this command to restart at boot and in the background even if i log off abefroman Linux - Security 1 09-07-2004 04:40 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 10:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration