Launchd - Run as if you're logged in as a user using sudo
You put the plist into /Library/LaunchDaemons but edit it to say which user the script will run as

The key you need to add is UserName. For example I run a newserver as user _news

&lt;key&gt;UserName&lt;/key&gt;
&lt;string&gt;_news&lt;/string&gt;


Documented in Apple's launchd man page