Run applications as another user without switching

May 21, '04 08:42:00AM

Contributed by: slughead

This is regurgitating a hint I got from the comments section of another hint about Apache (I think). What this does is allow you to keep a program within the constraints of another user, without having that user logged in via the GUI. Run a suspect program within a bubble! I'd advise setting up a dummy account with very limited access if you wanted to make a "bubble." Note: I'm going to refer to the subsequent account as the "bubble account" and that account's session as the "bubble" from now on to give you the right idea about this.

  1. Open a new terminal window
  2. Type the following where short_name is the short name of the "bubble" account: sudo short_name -
  3. Type the password to the "bubble" account.
  4. Type the following where app_name is the name of the app you wish to open:
    /Applications/app_name.app/Contents/MacOS/app_name
    For instance, this would launch Safari:
    /Applications/Safari.app/Contents/MacOS/Safari
A couple of things to remember (very important!): I've tested this thoroughly, and it's pretty interesting I think.

[robg adds: This hint is the generic version of Run Mail as another user. I thought it was worth sharing the generic form in addition to the specific example...]

Comments (20)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040518224230789