Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>System>>How to log other users out

How to log other users out


sooth
03-16-2006, 04:33 PM
How can I log other users out that are logged in without rebooting the computer? I have Admin privledges. I am using 10.4.5

giskard22
03-16-2006, 06:17 PM
You can kill their loginwindow process. A user's entire session runs under the loginwindow task, and each user session gets its own "copy".

Open Terminal, type the following, and press return:
ps -Ajc | grep loginwindow
This creates a list of all running processes, then runs the list through a filter and displays any lines of data that contain "loginwindow".

The first column will contain the name of the process owner. The second column contains the process ID #. Let's say you did this, and the user's session you want to kill has process ID 361. The next thing you'd type is:
sudo kill 361
You'll be prompted for your administrator password. After you enter it, the user's session will be immediately ended.

Be aware that this is not a "nice" logout. It immediately terminates every process that user had running. So if there was any unsaved work, or a file transfer in progress, or whatever, those things have just been lost.

For those with greater UNIX savvy than I: it seems like you should be able to use 'killall' and skip getting the process ID, but I've never made it work for this. :)

NovaScotian
03-16-2006, 08:41 PM
Although I don't know how to do it, in other Unix systems I've worked in, the Admin normally warned all users that their processes would be terminated in xx minutes before he did this. There must be a facility for doing it. (Hayne would know).

yellow
03-16-2006, 09:15 PM
Although I don't know how to do it, in other Unix systems I've worked in, the Admin normally warned all users that their processes would be terminated in xx minutes before he did this. There must be a facility for doing it. (Hayne would know).

This isn't really applicable in this case. In the UNIX world where people are working via xterm, when a processess is terminated and the user is warned it's typically becaue the user isn't sitting at the console.

Where in this case (at least what I take the OP to be asking), the user is logged in and absent, and therefore sending a message via command line won't reach the user. Besides, it wouldn't reach them anyway unless they were using Terminal (or some other command line interface).

To the OP, you should look at Apple Remote Desktop if you're supporting a computer remotely. It has tons of nice tools, one of which is log out the remote user.

hayne
03-16-2006, 09:17 PM
Although I don't know how to do it, in other Unix systems I've worked in, the Admin normally warned all users that their processes would be terminated in xx minutes before he did this. There must be a facility for doing it.

I think you are thinking of what happens when the admin uses the Unix command 'shutdown' with a time interval.
That's not applicable in this case as sooth apparently wanted one user to remain logged in.

giskard22
03-17-2006, 09:03 AM
To the OP, you should look at Apple Remote Desktop if you're supporting a computer remotely. It has tons of nice tools, one of which is log out the remote user.
ARD's logout function only affects the foreground user, i.e. the one whose desktop is visible. If you want to end a user session that's been fast-switched away, ARD won't help (except by letting you send the above shell commands ;)).


 

TOP

For more info

Core Graphics problem?
Moving the default loc
Delay Before Sleep? 
Quicktime Death 
Boot hangup message 
A lot of corruption pr
~/.MCXLC file and 10.2
Burned DVD data discs 
Creating CUstom Boot I
Console/virtual termin

News Archive

Firewall problems on M
installing osx (10...1
console--what's this? 
Safari and issues with
problem when restart M
My iMac G5 1.8Ghz Hard
Automatically loading 
ibook g3 won't turn on
better choice for empt
How to log other users

Related stories:

problem when restart Mac
My iMac G5 1.8Ghz Hard Drive has disappeared!
Automatically loading (mounting) DMG files upon startup?
ibook g3 won't turn on sometimes
better choice for emptying trash
CD-R burn/verify problem
Locking files on harddrives from erasing!

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics