New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus ē Advice and insight from world-class Apple enthusiasts ē Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Running sudo command as _www user


Post Reply New Thread Subscribe

 
Thread Tools
jamessw

 
Member Since: Mar 12, 2010
Posts: 3
jamessw is on a distinguished road

jamessw is offline
I have a web site on a Mac server that uses php's "exec" function to run a bash script on the server. It's password protected, and can only run certain code, so I'm not worried about security.

My problem is that I want to add a feature that requires the sudo command. However, the script is run by the user _www, which apparently can't do the sudo command.

What are my options for making this work?
Thanks!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Ottawa
Posts: 17,109
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Try following the instructions here to add the user to the sudoers file. Now, you're going to need root access to this machine to edit the sudoers file. Do you have access?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Mac-Forums Investigates MacKeeper - Confused about MacKeeper? Take a look at this review.
QUOTE Thanks
jamessw

 
Member Since: Mar 12, 2010
Posts: 3
jamessw is on a distinguished road

jamessw is offline
I added _www to sudoers, and it still doesn't work. Also, I just realized I've been using the admin password, and have no idea what the _www password would be. It should still be the default.

Any idea what this would be?
QUOTE Thanks
jamessw

 
Member Since: Mar 12, 2010
Posts: 3
jamessw is on a distinguished road

jamessw is offline
Ok, it's trickier than I thought.

The script must be run as root. Is there any way I can run a script as root from _www?

Another option is to disect the script, and add the actual commands directly into my script. They seem to just be a set of 3 launchctl commands. How can I run launchctl commands as _www?
QUOTE Thanks

Post Reply New Thread Subscribe


« MBA-specific issue: restoring from time machine | Automator issue with "permissions" »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Issue running FTP server! Bassi OS X - Operating System 5 09-29-2009 06:01 PM
Transferring User Settings from iBook harddrive to New Mac Pro beanlynch OS X - Operating System 1 06-24-2009 03:43 PM
running slow. need more ram ? vinegret Apple Notebooks 5 10-12-2008 10:02 AM
G5 Doesn't Find Right User Files After Restore SargassoC OS X - Operating System 0 03-03-2008 02:23 PM
The "Home" for user 'x' cannot be found in the usual place.... OSX 10.3.9 grantscooter OS X - Operating System 2 03-22-2007 07:59 AM

All times are GMT -4. The time now is 10:07 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?