Our server has been locked by a person who haven't logged out after working on it, so now I cannot access it without restart. Can I somehow allow via SSH fast user switching without restarting the system? It's running Snow Leopard.

  • I have changed the question to make it more clear. – Andrei Jul 21 '10 at 18:49

To turn on Fast User Switching from the command line:

defaults write /Library/Preferences/.GlobalPreferences MultipleSessionEnabled -bool YES

Change to NO to turn it off.

To trigger Fast User Switching from the command line (if necessary):

#Login Window
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

#Specific User
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID UID_OR_SHORT_USERNAME_HERE
| improve this answer | |
  • This does nothing for me. Fast user switching is on. The CGSession command produces no output (no error message, no prompt for password, nothing) and does nothing - user is not switched. As a note, I'm trying to do this remotely over SSH if that makes any difference. – Michael Jul 14 '13 at 19:00
  • The CGSession command doesn't work with short names. It works with user IDs however. Lookup a user's ID via their short name with id -u usershortname (should be 501, 502, 503, etc). Then use that in the CGSession command. – Jonathan Dumaine Aug 14 '14 at 7:37

OSX is Unix so you can ssh into it even if someone is logged in - if you have have set in System Preferences->Sharing->Remote Login

If that is not set then you will need to login as admin sitting at the mac to change that - as there is user switching you don't need to log the other person out

| improve this answer | |
  • Yeah, that's what I can do. But I also want to log in directly to this computer (not remotely) – Andrei Jun 29 '10 at 8:33

What do you mean with "access"? Access via VNC or Apple Remote Desktop? Do you want to open multiple VNC Sessions?

AFAIK that's not possible.

edit: I found this: http://www.testplant.com/multidesktop.html I hope it helps. It doesn't seem to be very comfortable nor for free.

| improve this answer | |
  • would the down-voter please comment on the vote? – lajuette Jun 8 '10 at 19:47
  • I didn't vote you down, but generally speaking, requests for more information should be added as comments, rather than answers. – coneslayer Jun 8 '10 at 19:50
  • It's correct that the first paragraph is a request for more info. But after that you can find my answer. Two answers to be exact. First my "not possible" and then the app i found after googling for a few minutes. – lajuette Jun 9 '10 at 7:37
  • I meant not remote access, but the direct one. Sorry if I call it wrongly, no idea how to say "logging in by using the keyboard of that computer" in one word – Andrei Jun 29 '10 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.