Discuss Problem in using sudo in the PHP Development forum on Dev Shed. Problem in using sudo PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 73
Time spent in forums: 21 h 2 m 2 sec
Reputation Power: 7
Problem in using sudo
I'm trying to setup sudo in my php script I need to execute a process to perform some processing. in my /etc/sudoer file I currently have the line (I used "visudo" to edit it)
However when I run the script it doesn't run the processing request. Is there something else I'm missing here? Also, do I need to reboot the linux box after I do visudo for it to take effect?
Posts: 117
Time spent in forums: 1 Day 18 h 53 m 58 sec
Reputation Power: 14
Or as a quick hacklike fix, you can enable the root account. However, this causes issues around security.
Then again, I tend to agree with the idea that it is waiting for the password. Try the shell script, that might just work without causing too much security issues.
But it still feels like you are setting yourself up to get hacked. Is this PHP script coming from the command line or on your web server? If it is from the web, perhaps you need to work on some creative CRON job running as a priviledged user.
Also, search the ubuntu forums, there you can find a way to enable the root account so you can make a script run as root, but once again, you could be setting yourself up for a seriously bad day by running a script that requires root privileges from PHP, can you perhaps tell us what exactly you are trying to do?
Posts: 73
Time spent in forums: 21 h 2 m 2 sec
Reputation Power: 7
If my linux box is setup as SELinux, will I still be able to do this?
Oh btw to get back to your question php script will be run as web server, it will submit a request for the user by running the executable in the background. the executable has only limited things that it can do and cannot take input from the user directly.
But it still feels like you are setting yourself up to get hacked. Is this PHP script coming from the command line or on your web server? If it is from the web, perhaps you need to work on some creative CRON job running as a priviledged user.
Also, search the ubuntu forums, there you can find a way to enable the root account so you can make a script run as root, but once again, you could be setting yourself up for a seriously bad day by running a script that requires root privileges from PHP, can you perhaps tell us what exactly you are trying to do?