Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mamcx

macrumors regular
Original poster
Mar 13, 2008
211
28
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)
 
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.
 
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.

If you're averse to using the command line, chances are you don't actually need to know how to do this.

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.
 
  • Like
Reactions: ppaula
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.
 
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.

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.
 
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.
well or just put the users in the same group and give the group permissions to the concerned files.
 
well or just put the users in the same group and give the group permissions to the concerned files.

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.
 
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.
 
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!
 
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.
 
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.

Except it doesn't always "automatically prompt" users for certain instances, like those given by others, like the post directly above yours.
 
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:

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)
 
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)
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:
 
Except it doesn't always "automatically prompt" users for certain instances, like those given by others, like the post directly above yours.
Saw it but could not identify. For instance, I never had to run disk utility a bazillion times. Once is enough.
 
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:
I know how to be safe with files.
Saw it but could not identify. For instance, I never had to run disk utility a bazillion times. Once is enough.

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.
 
I don't see anyone mentioning disk utility so not sure what you're talking about.
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".
 
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
 
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".

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."
 
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

That's really more of a workaround though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.