Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superbovine

macrumors 68030
Nov 7, 2003
2,872
0
ungar said:
Is there a command in Terminal to logoff other users?

I assume you mean logout users from the shell.

Code:
cow@supercow cow $ps -u cow
USER   PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
cow    895   0.1  0.1    27804    840  p2  S    11:34AM   0:00.02 -bash
cow    883   0.0  0.1    27804    852  p1  S+   11:31AM   0:00.06 -bash
cow@supercow cow $kill -9 883
cow@supercow cow $

that killed the second instance of my shell basically logging me out.
 

ungar

macrumors member
Original poster
Feb 11, 2006
62
0
Paris
Sorry; I'm pretty illiterate when it comes to Unix -- indeed, I don't know what "shell" means. Quite simply, I wanted to change certain permissions regarding my daughter's account, but, since she was logged in, I first had to switch to her account and log her out, then switch back to mine. So my question is: is there something I could have typed in Terminal after the prompt to log her out? Assume her account is called "daughter": what should I type?
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
Try:

shutdown -k now

It may need to instead be:

sudo shutdown -k now

But I'm not 100% sure this won't also log you out.

The -k means "kick everybody off." sudo means to execute the command with superuser (~ root) privileges. So if you need the sudo part, you will also be asked to give your password. And you will not be able to do it using sudo unless you are using an admin account (but you are so that's ok), because non-admins are not allowed to use sudo.
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
ungar said:
So I can't just kick one user off; it has to be all users?

You can, but I'm not sure if you can in a nice way. The way described by the previous poster basically involves finding the login process of the user in question and killing it. It's like a house of cards. When you pull the card at the bottom out, the house falls down and the user gets logged out. But that's not a "nice" way, in that it may or may not allow programs to shut down smoothly....

I think there is probably a "nice" way, but I'm not 100% sure. I think in the Unix tradition, people do it the not-nice way.

This is very technical but might also help....

http://forums.macosxhints.com/showthread.php?t=23830
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.