Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Create a 'Run As' contextual menu command System 10.4
Tiger only hintI needed to install some software today while logged in on my cousin's account, but wasn't able to because she is not an Administrator. The Vise installer would not let me authenticate, and I didn't really want to login as myself just for an install, so I thought this would be a great time to put Automator to use. This is an extremely simple hint, but hopefully it will save you some time in the future.

First off, you need Pseudo -- it's a utility that allows you to run programs as another user, provided you have their username and password. Download Pseudo and drop it in your Applications/Utilities folder. Now open Automator and start a new workflow. You only need one action to make this work.

Select Finder from the Applications list on the left and drag the "Open Finder Items" action to the workflow area on the right. By default, it says "Open with: Default Application." Click this drop-down, choose "Other..." from the bottom of the list, and find Pseudo in your Applications/Utilities folder.

Now choose File: Save As Plug-In..." and name it "Run As..." Also, make sure "Plug-in for: Finder" is selected. Now quit Automator and go find an application you'd like to open. Control- or (right-) click the app and choose "Automator -> Run As..." from the pop-up menu. You'll now be prompted for a username and password, and your app should run with the privileges of that user. Hopefully this will helpful to some of you.
    •    
  • Currently 2.75 / 5
  You rated: 2 / 5 (4 votes cast)
 
[14,009 views]  

10.4: Create a 'Run As' contextual menu command | 10 comments | Create New Account
Click here to return to the '10.4: Create a 'Run As' contextual menu command' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Create a 'Run As' contextual menu command
Authored by: dfbills on Aug 26, '05 11:42:59AM

Very cool- thanks!

---
-d



[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: bdog on Aug 26, '05 04:08:13PM

Nice hint. Very simple. :-)

However, Psuedo only lets you open the app as 'root'.



[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: nlemac on Aug 26, '05 10:58:13PM

You can just open the terminal and type "sudo open /path/to/vise-installer", Enter password, and the installer will open and run as root.

---
//nlemac



[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: _merlin on Aug 27, '05 06:52:16AM

That won't work. The open tool will change UID to the user who is currently logged into the GUI. You could use:


sudo /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp /Path/To/Vise/Installer


[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: pme on Aug 27, '05 05:31:46PM

The "sudo open" command won't work for me even in 10.3 since I'm not a member of the sudoers file om my computer.

If Pseudo lets me run the app as a separate user that's a great benefit for me.

/P-M



[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: pme on Aug 27, '05 05:40:14PM

Correcting myself... Pseudo definitely won't let me run an app as another user (and thereby run it as System Admin or root).



[ Reply to This | # ]
Really run as any user?
Authored by: stewby on Aug 28, '05 03:41:26AM

Is this hint accurate? I'd be extremely surprised if it's actually possible to run things as an arbitrary user, since I don't think it's possible (at the system level) to run a GUI program as anything but root or the current console user--nothing else should have access to the correct bootstrap context.

The dialog to enter a user name and password is presumably just Pseudo triggering the standard system dialog authorizing it to run with administrator privileges. You can log in as any administrator user there, but it runs as root, not that user.



[ Reply to This | # ]
Really run as any user?
Authored by: mazatty on Aug 28, '05 01:03:13PM

it's certainly possible to run apps as any user. i do it all the time and haven't had any problems, not to say there aren't any. you just use sudo from the terminal with the "-u" options.

sudo -u guest /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal



[ Reply to This | # ]
Really run as any user?
Authored by: dc_rees on Aug 29, '05 01:30:12AM

That's cool.

For some reason, the last time I tried that I tried specifying the path only down to application.app. I didn't think to try specifying all the way to the launch script.

Now I know how to drop privileges for web access. I can add one more layer to the wall between potentially bad sites and my machines.

---
Say yes to CPU multiculture



[ Reply to This | # ]
10.4: Create a 'Run As' contextual menu command
Authored by: dc_rees on Aug 29, '05 01:22:37AM

Just a voice of caution --

If someone has successfully installed a keylogger on the account you are using sudo or pseudo from, they will very likely capture any passwords you use from that account.

(In case anyone is curious, yeah, I'm paranoid enough I don't use a web browser from an administrator account.)

The real advantage of sudo is for reducing privileges, not raising them.

---
Say yes to CPU multiculture



[ Reply to This | # ]