Is it possible to login to another account from Terminal? I don't mean having a shell prompt as that user; I mean as if I went to the account switcher menu and changed using that.
-
What are you trying to do? A miox of apps running as different people on the screen?– mmmmmmNov 9, 2016 at 23:45
-
@Mark No; I'm essentially looking for a way to switch users similar to the login screen. Like how you would go to the login screen and log in as a user you'd be taken to the desktop of that user. That but from Terminal.– atiritNov 9, 2016 at 23:52
1 Answer
Show the login screen (without logging out):
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Switch current user (replace 501 with the correct UID):
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID 501
(found at http://www.chipwreck.de/blog/2008/01/26/fast-user-switching-via-commandline/.)