How to allow fast user switching on a remote Mac?

3

1

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.

Andrei

Posted 2010-06-08T08:23:06.950

Reputation: 1 164

I have changed the question to make it more clear. – Andrei – 2010-07-21T18:49:50.560

Answers

7

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

Chealion

Posted 2010-06-08T08:23:06.950

Reputation: 22 932

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 – 2014-08-14T07:37:07.200

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 – 2013-07-14T19:00:04.857

1

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

user151019

Posted 2010-06-08T08:23:06.950

Reputation: 5 312

Yeah, that's what I can do. But I also want to log in directly to this computer (not remotely) – Andrei – 2010-06-29T08:33:26.753

0

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.

lajuette

Posted 2010-06-08T08:23:06.950

Reputation: 4 364

would the down-voter please comment on the vote? – lajuette – 2010-06-08T19:47:10.387

I didn't vote you down, but generally speaking, requests for more information should be added as comments, rather than answers. – coneslayer – 2010-06-08T19:50:32.537

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 – 2010-06-09T07:37:23.257

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 – 2010-06-29T08:35:53.427