Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Is it possible to log out remotely? -help-

Is it possible to log out remotely? -help-
Thread Tools
BTP
Mac Elite
Join Date: Feb 2001
Location: 34.06 N 118.47 W
Status: Offline
Reply With Quote
Jan 15, 2004, 09:20 PM
 
I occasionally leave my computer on and I would much rather prefer to have it secured. I can access it via SSH and reboot, but I want only to log myself out. Can that be done via logging in with SSH?
A lie can go halfway around the world before the truth even gets its boots on. - Mark Twain
     
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Jan 15, 2004, 09:48 PM
 
You can with ARD....
     
BTP  (op)
Mac Elite
Join Date: Feb 2001
Location: 34.06 N 118.47 W
Status: Offline
Reply With Quote
Jan 15, 2004, 10:01 PM
 
thought of that.. It's not available right now.. Any other suggestions?
A lie can go halfway around the world before the truth even gets its boots on. - Mark Twain
     
Mac Elite
Join Date: Mar 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 15, 2004, 10:15 PM
 
ssh in and kill loginwindow
     
Mac Elite
Join Date: Mar 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 15, 2004, 10:19 PM
 
or to be more detailed, ssh in to your machine, run top and find the PID for loginwindow (it'll be near the bottom) then type sudo kill ### where ### is the PID for loginwindow.

That ought to do it. If you can't find loginwindow there try ps -auwwwx | grep loginwindow

The PID should be in the first row, 2nd column, right after your username (whoever's logged in on that machine)
     
BTP  (op)
Mac Elite
Join Date: Feb 2001
Location: 34.06 N 118.47 W
Status: Offline
Reply With Quote
Jan 15, 2004, 11:12 PM
 
Really?

That will kick me to the login window!?

Excellent?

I'm going to try it. I'll know if it worked in the morning.
A lie can go halfway around the world before the truth even gets its boots on. - Mark Twain
     
Forum Regular
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jan 15, 2004, 11:25 PM
 
Originally posted by awaspaas:
or to be more detailed, ssh in to your machine, run top and find the PID for loginwindow (it'll be near the bottom) then type sudo kill ### where ### is the PID for loginwindow.

That ought to do it. If you can't find loginwindow there try ps -auwwwx | grep loginwindow

The PID should be in the first row, 2nd column, right after your username (whoever's logged in on that machine)
you only need one 'w' (-auwx)
     
Mac Elite
Join Date: Mar 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 16, 2004, 12:29 AM
 
you're right - why did i think it was auwwwx i wonder?
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 16, 2004, 08:41 AM
 
Originally posted by awaspaas:
you're right - why did i think it was auwwwx i wonder?
Because ps -auxw produces this:

Code:
[arkham@flybook ~] ps -auxw | grep login arkham 181 0.0 0.8 68576 4956 ?? Ss 8:19PM 0:10.59 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/logi
while ps -auxww produces this:

Code:
[arkham@flybook ~] ps -auxww | grep login arkham 181 0.0 0.8 68576 4956 ?? Ss 8:19PM 0:10.59 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console
The extra "w" makes the line that is displayed longer. I don't know that the third "w" does anything though.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jan 16, 2004, 09:46 AM
 
heh, i used to do this to my mate's mac, all the time. funny

by the way, you can be as short as this:
ps ax | grep loginwindow
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 16, 2004, 06:33 PM
 
Be careful when doing this though, you won't have the opportunity to save unsaved changes and I'm not certain if it will quit "cleanly" (i.e. any files that are written to at that moment might become corrupt).
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:41 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2