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

slughead

macrumors 68040
Original poster
Apr 28, 2004
3,107
237
If you have your user folder on another drive (or many other potential causes), certain programs such as Private Internet Access (a VPN program) can repeatedly ask you for your password.

One solution I found is to actually run the program as root.

First, I made it so launching the program as root doesn't ask for a password.

Go into terminal and do this

Code:
sudo pico /etc/sudoers

next go to the bottom of the file and give the address to the binary, in the case of private internet access, it's this:

Code:
slughead ALL=(root) NOPASSWD: /Applications/Private\ Internet\ Access.app/Contents/MacOS/launch_pia

Replace "slughead" with your username.

Next, I made an Applescript which basically launches the program:

Code:
do shell script "sudo /Applications/Private\\ Internet\\ Access.app/Contents/MacOS/launch_pia  > /dev/null 2>&1 &"

Adding the " > /dev/null 2>&1 &" at the end like that will allow the script to quit afterwards.

Save the script as an application, throw it in your login items or whatever you want to do.

It's technically insecure to automatically run programs as root w/o a pw, however 1) you're making it so only your user has that ability 2) in order to use this to exploit the computer, you'd have to replace the application's binary with something malicious --which you can't do without a password anyway.

In short, not a big deal, everything's working great.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.