How in OSX "Run As" and "Open As" (not command-line)

Discussion in 'macOS' started by mamcx, Mar 10, 2009.

  1. mamcx macrumors regular

    Joined:
    Mar 13, 2008
    #1
    Hi, I miss from windows the option of "Run As" or "Open As" from the contextual menu.

    I wonder if exist a option to enable it (and not resort to command line)
     
  2. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #2
    Never seen a feature like that. Why would you need to do that anyway? Maybe there's something we can help with to eliminate that as a need.
     
  3. DoFoT9 macrumors P6

    DoFoT9

    Joined:
    Jun 11, 2007
    Location:
    Singapore
  4. ppc750fx macrumors 65816

    Joined:
    Aug 20, 2008
    #4
    If you're averse to using the command line, chances are you don't actually need to know how to do this.
     
  5. edesignuk Moderator emeritus

    edesignuk

    Joined:
    Mar 25, 2002
    Location:
    London, England
    #5
    What is it you're doing that needs you to do this?

    Installers/file copies will prompt for admin name/pw if required.
     
  6. mamcx thread starter macrumors regular

    Joined:
    Mar 13, 2008
    #6
    Is not for installers.

    The way OSX work now is very similar to Vista (prompt for admin, but not runas enabled).

    I want it because I have a couple of users in the same machine, and sometimes we need see the files of others or run programs with thir credentials. And i don't like the idea to put files on the shared area.

    Seriusly, that is the kind of comment I expect from a linux user!

    I can, and know, how use command-line. I'm a profesional developer, but then, why use it if can be avoid?

    The question is simple: Can be done, exist or not. If not, the life move on because is a small thing.
     
  7. pooky macrumors 6502

    Joined:
    Jun 2, 2003
    #7
    The short answer is no, there is no built-in GUI tool for this. The closest you will get is to enable fast user switching, then switch to the user you want to run as. Or use the CLI. Or just set ACLs properly on your machine, so that if you need to share files with a particular user, they are shared.
     
  8. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #8
    You could chown the file to the user you want to run it as and the change the permissions so it runs setuid. Then whenever it is executed, it is run as that user.
     
  9. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #9
    well or just put the users in the same group and give the group permissions to the concerned files.
     
  10. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #10
    That will not make the file run as a particular user. That only allows the two users to run the same file, and it will run as the user who launched it.
     
  11. mamcx thread starter macrumors regular

    Joined:
    Mar 13, 2008
  12. mofomikes macrumors newbie

    Joined:
    Jun 16, 2009
    #12
    an example of a useful application to this would be for Wireshark that is available for OS X. initiating the application starts up with no network interfaces are present due to permission issues. running the application package from command line as root solves the issue.
     
  13. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #13
    But the OP does not want to use the command line.
     
  14. Jethryn Freyman macrumors 68020

    Jethryn Freyman

    Joined:
    Aug 9, 2007
    Location:
    Australia
    #14
    Don't think it can be done, apart from the command line. There's no need to do it, really.
     
  15. krezreb macrumors newbie

    Joined:
    Nov 17, 2009
    #15
    Yes there are legit uses for a "Run As" function in OS X

    For example....If you're a non-admin user and you want to be able to view system logs in the Console app, or run disk utility without having to type in your password a bazillion times.

    There's a lot of good reasons not to have the main account you use not have admin rights. But that's another debate.

    In any case I found this forum while searching for"Run As" for the mac and haven't seemed to find anything out there, so I went ahead and wrote it myself.

    It can be downladed here: here

    Cheers!
     
  16. macrem macrumors 65816

    macrem

    Joined:
    Mar 11, 2008
    #16
    OS X will automatically prompt the user for the user name & password of a user who has privileges when the current user does not, which is a much better user experience than the "run as" MS feature.
     
  17. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #17
    Except it doesn't always "automatically prompt" users for certain instances, like those given by others, like the post directly above yours.
     
  18. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #18
    It looked promising, but didn't work. It had an AppleScript error after putting in login credentials. Error given below. Looks like the path was hard-coded, which doesn't work very well.

    Code:
    AppleScript Error
    File file Macintosh HD:Volumes:Fun:Joey:.76414..many numbers wasn't found (-43)
     
  19. macrem macrumors 65816

    macrem

    Joined:
    Mar 11, 2008
    #19
    You're pretty brave! Please don't let us find you here reporting "SL bugs" that only you & about 10 other users are experiencing :rolleyes:
     
  20. macrem macrumors 65816

    macrem

    Joined:
    Mar 11, 2008
    #20
    Saw it but could not identify. For instance, I never had to run disk utility a bazillion times. Once is enough.
     
  21. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #21
    I know how to be safe with files.
    I don't see anyone mentioning disk utility so not sure what you're talking about. Most people probably can't identify, as they generally run as Admin. For people like myself though, that run as standard accounts, the utility of this functionality is more apparent. It's rare for me to need something like Run As, and when I do, it's partly because of apps that are not written as well as they could be, like Onyx.
     
  22. macrem macrumors 65816

    macrem

    Joined:
    Mar 11, 2008
    #22
    It's right there in the message you referred me to: "If you're a non-admin user and you want to be able to view system logs in the Console app, or run disk utility without having to type in your password a bazillion times."

    I also log in daily as a regular user and recommend to others to do the same.

    Whenever higher priv's are needed, OS X prompts me for Admin priv's, which works brilliantly and overall is better than "run as".
     
  23. macrem macrumors 65816

    macrem

    Joined:
    Mar 11, 2008
    #23
    Furthermore, btw, I just opened the appfirewall.log from my regular user account without using the CLI. Normally I am a fairly heavy CLI user but just to prove it's possible completely in the GUI:
    1. open Console
    2. go to any log you do not have permission to read (grey colored text)
    3. drag/drop the log file onto TextWrangler icon (in Dock)

    OS X then prompts for an Admin password & if you have it, you'll be reading the log :D
     
  24. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #24
    Ah, I see it now, I was looking prior to that post. In fairness to that post, it was talking about entering the user name/password a bazillion times, not running disk utility a bazillion times.

    OSX doesn't always prompt though. Try opening Console as a standard user and view the system.log file or the firewall logs. They are grayed out without an option to authenticate and no prompt ever comes up. Also, as I hinted before, Onyx cannot be run as a standard user. It only asks for the admin password, but not the user name, so again another example of things not working so "brilliantly."
     
  25. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #25
    That's really more of a workaround though.
     

Share This Page