"Run as" Application as different user

Discussion in 'OS X' started by willybNL, May 22, 2007.

  1. willybNL
    Expand Collapse
    macrumors 6502

    #1
    In windows and linux I'm able to run programs as other users. Eg. I want to start mail as user '2', while being logged in as user 1.

    Howto?

    Or something like 'fast changing user' while the other stays login... how to?
     
  2. Mitthrawnuruodo
    Expand Collapse
    Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #2
    System Preferences -> Accounts -> Login options: Check "Enable fast user switching"
     
  3. tyr2
    Expand Collapse
    macrumors 6502a

    tyr2

    Joined:
    May 6, 2006
    Location:
    Leeds, UK
    #3
    If it's just one command you want to run as another user use sudo.

    'sudo -u theusername thecommand'
     
  4. willybNL
    Expand Collapse
    thread starter macrumors 6502

    #4
    Yep... but how to this graphically in finder? or in the dock.
     
  5. epochblue
    Expand Collapse
    macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #5
    AFAIK, the only way to do this is to use fast user switching or write some kind of AppleScript or Automator Action that uses the sudo -u command underneath.
     
  6. SC68Cal
    Expand Collapse
    macrumors 68000

    Joined:
    Feb 23, 2006
    #6
    No, no no!

    Log into user 2 in terminal. Don't use sudo!

    Just use fast user switching.
     
  7. MagicUK
    Expand Collapse
    macrumors regular

    MagicUK

    Joined:
    May 12, 2007
    Location:
    Hampshire, England
    #7
    Okay so you have described what, now describe how.

    So we are logged on as user 1 how do we invoke a terminal session as another user?

    Please be gentle.
     
  8. MacsRgr8
    Expand Collapse
    macrumors 604

    MacsRgr8

    Joined:
    Sep 8, 2002
    Location:
    The Netherlands
  9. SC68Cal
    Expand Collapse
    macrumors 68000

    Joined:
    Feb 23, 2006
    #9
    open terminal

    type
    Code:
     login user2
     
  10. MagicUK
    Expand Collapse
    macrumors regular

    MagicUK

    Joined:
    May 12, 2007
    Location:
    Hampshire, England

Share This Page