0
votes
3answers
49 views

Securely executing system commands as sudo from PHP

Is it possible? I have written a command line tool in PHP for creating new environments for our company. It creates system users, directories, databases, VHosts and restarts apache, amongst other ...
1
vote
1answer
196 views

Allow normal user to run PHP script as root using SUDO

How can I allow a normal user on Ubuntu to run php scripts? sudo php /path/to/script/script.php Basically the script needs to be run as root but the users does not have root privileges on their ...
-2
votes
1answer
2k views

How to set up SUDO rights for execution of Python script from PHP [closed]

I run Raspbian Wheezy on my Raspberry Pi, and i want to call a Python script from PHP. That all works great (i call 'exec python go.py' from php) but now i want to call a script which needs root ...
1
vote
3answers
498 views

Calling sudo within a script that was called with sudo prompts for password even with NOPASSWD

A PHP program I am working with (LConf) calls a script using sudo. I have allowed the user apache to run the script and have tested with sudo -u apache /usr/local/LConf/lconf_deploy.sh. I am being ...
2
votes
2answers
347 views

How safe is it to allow www-data to run sudo quota?

I manage the hosting of a custom Software-as-a-Service (SAAS) CMS and Ecommerce system. This system is powered by a cluster of LAMP servers behind an HAproxy instance, and each customer / domain has ...
0
votes
2answers
133 views

Can I get mailman's newlist script to run without needing sudo?

I'm writing a PHP application and I want to be able to add new lists to mailman running on my ubuntu server. For one reason or another, mailman's newlist script requires root privileges. Is there any ...
1
vote
1answer
256 views

Granting php sudo acsess

I am trying to grant php sudo access (for automated share mounting). I was sucess full at granting php sudo access on one of my systems by adding daemond to the list of sudo's via su --login -c ...
2
votes
2answers
962 views

Problems restarting apache via PHP (even with sudo)

As part of the signup process on our site, VirtualHost directives get created an added to a config file via PHP, after each VirtualHost is created apache is restarted gracefully so that the new site ...
3
votes
4answers
7k views

Allow Apache to run a command as a different user

I have a script that executes several commands in a user's home directory. The files are owned by the user and Apache (the www-data group) only has read privileges to them. The script needs to be ...
1
vote
1answer
818 views

running bash script as root with hardcoded password

Most probably this has already been answered in other threads, but I can't find the exact solution. I need to call a bash script via a php script which (bash) changes system time. I need to run that ...