Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Run app as root

Hi,

I would like to know if there is any way of running an application as root by just clicking on the app's icon instead of going to the terminal window every time.

Thank you.

Macbook C2D, Mac OS X (10.6.4)

Posted on Nov 2, 2010 9:01 AM

Reply
10 replies

Nov 3, 2010 9:20 AM in response to MartinR

The app is GNS3..In order for me to work with the tap drivers and GNS3, I need to run the application as root so I can save it.

Here was my original situation, I run GNS3 as root and I created a tap interface. I assigned an ip address and subnet mask to it. I saved my project and next time I opened it, it said that i couldn't create the interface. I opened it with root access and I got it back but the ip address and mask were gone.

Now, I am trying to open it with root access so I don't have any issues.

Nov 3, 2010 6:47 PM in response to macuser1801

You'd be better off creating a LaunchDaemon that changes the permissions on the bpf devices. For example, one called org.tcpdump.chmod_bpf.plist with the following contents:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.tcpdump.chmod_bpf</string>
<key>Program</key>
<string>/usr/local/bin/chmod_bpf</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

Then in /usr/local/bin, you have the chmod_bpf script (owner root:wheel, perm 755) with the contents:

#! /bin/sh
chgrp admin /dev/bpf*
chmod g+rw /dev/bpf*


That way you can set up interfaces without having to run programs as root.

Basically, this is the setup for Wireshark, which I modified from a startup item to a LaunchDaemon following similar advice on the tubes (I take no credit for the idea at all).

Cheers.

Nov 4, 2010 12:24 PM in response to etresoft

Guys,

I apologize but I am not a developer and I have little knowledge when it comes to Mac os x folder structure; therefore, it is hard for me to implement some of those scripts you have suggested.

How do I do an applescript? Remember, I don't want just to run terminal as a root but the application itself. I don't want to use terminal every time I have to open GNS3.

Thanks.

Nov 4, 2010 6:14 PM in response to macuser1801

Did you look at Pseudo ?
http://personalpages.tds.net/~brian_hill/pseudo.html

It's a very old program, but it still seems to work in OS X 10.6.

You can drag an application icon into the Pseudo window to run the app as root, or you can use Pseudo's File menu to easily create and save a "Launch Document" for an application. Double-clicking such a Launch Document then runs the application as root. You can optionally store the admin password needed for authentication in your keychain.

Run app as root

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.