[opensuse] log user out from kde via ssh?
Listmates, If I want to log a user out from a kde session after I have connected to the box via ssh, how is the right way to do it? I would like to do it gracefully so applications close and aren't just crashed. Would 'kill /bin/sh /usr/bin/startkde3' be a way to do that? -- David C. Rankin, J.D.,P.E. | openSoftware und SystemEntwicklung Rankin Law Firm, PLLC | Countdown for openSuSE 11.1 www.rankinlawfirm.com | http://counter.opensuse.org/11.1/small -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 24 November 2008, David C. Rankin wrote:
If I want to log a user out from a kde session after I have connected to the box via ssh, how is the right way to do it? I would like to do it gracefully so applications close and aren't just crashed. Would 'kill /bin/sh /usr/bin/startkde3' be a way to do that?
I don't know much about being graceful... :-) But there's several options available to you, as far as I see it. First, and the most graceful way I can think of: -> kdeinit_shutdown. First of all, you need to be root to do this. 1) Find out which terminal a user is running on: # who user1 :0 2008-11-24 10:19 user2 pts/1 2008-11-24 10:21 etc. 2) Become the user you want to log off # su - user1 3) Export the DISPLAY variable to match that user's display: # erport DISPLAY=:0 (don' forget the colon) 4) Kill the session: # kdeinit_shutdown. And that takes care of that session. :-) Second and less graceful: -> The skill command (be root) Kill and logout user user1: # skill -KILL -u user1 And that really takes care of that session. Okay, so I am not one for grace, but it gets the job done. Plus, if I need to interrupt a user's session like that, you can bet it's for a reason ;-) HTH, Joop
On Tue, Nov 25, 2008 at 07:30, David C. Rankin
If I want to log a user out from a kde session after I have connected to the box via ssh, how is the right way to do it? I would like to do it gracefully so applications close and aren't just crashed. Would 'kill /bin/sh /usr/bin/startkde3' be a way to do that?
Hi David, I'm not sure about the right way but I thought you'd appreciate these two ideas: 1) dcop Something like `dcop kdesktop default logout`? You might need to do some hackery to get the dcop call passed to your (or whoever's) dcop session. 2) krfb I used to use this trick when I left a document open or IM client logged in when I went to work: krfb setup to accept connections correctly but forgot to start it? ssh to box (tunneling the VNC port for later), run `krfb -display :0` then VNC to machine and bingo - the console's desktop. You could use it to logout the desktop too, I guess :) Cheers, henare -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* David C. Rankin
Listmates,
If I want to log a user out from a kde session after I have connected to the box via ssh, how is the right way to do it? I would like to do it gracefully so applications close and aren't just crashed. Would 'kill /bin/sh /usr/bin/startkde3' be a way to do that?
To kill all processes of a particular user from root at unix prompt type: # kill -9 `ps -fu username |awk '{ print $2 }'|grep -v PID` -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan wrote:
* David C. Rankin
[01-01-70 12:34]: Listmates,
If I want to log a user out from a kde session after I have connected to the box via ssh, how is the right way to do it? I would like to do it gracefully so applications close and aren't just crashed. Would 'kill /bin/sh /usr/bin/startkde3' be a way to do that?
To kill all processes of a particular user from root at unix prompt type:
# kill -9 `ps -fu username |awk '{ print $2 }'|grep -v PID`
Thanks Joop, Henare and Patrick The users I need to bounce --- are my kids. They keep leaving their KDE session running and often leave a browser up to one of the kids internet sites for online games, etc... You wouldn't believe how much bandwidth out of a 1 meg connection can be taken up just with the normal switching of polly pockets videos and animated banners that goes on at those sites. Sheesh! When I do notice a bit of slowness on the internet connection long after the kids have already gone to bed, I just needed a quick way to kill their session. I'm getting a bit lazy. I mean, I could just walk over there --- but that would take all the fun out of it ;-) Thanks! -- David C. Rankin, J.D.,P.E. | openSoftware und SystemEntwicklung Rankin Law Firm, PLLC | Countdown for openSuSE 11.1 www.rankinlawfirm.com | http://counter.opensuse.org/11.1/small -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
David C. Rankin
-
Henare Degan
-
Joop Beris
-
Patrick Shanahan