LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   scripting "execute this as user/passwd" (https://www.linuxquestions.org/questions/linux-newbie-8/scripting-execute-this-as-user-passwd-652089/)

JohnnyRuin 06-27-2008 11:00 AM

scripting "execute this as user/passwd"
 
Hi

I've got a perl based website running as 'nobody' with the need to execute a privileged command (modify stuff in /home/someuser). As it happens I've got the username and password in the perl environment. The su command would work for me except it doesn't allow the password to be entered in a script. I don't want to allow 'nobody' any permissions via sudo.

In summary, given I'm running as 'nobody' I want to script executing commands as 'someuser' and I have the password for the account for 'somesuser'. What's the recommended approach?

Mr. C. 06-28-2008 01:54 AM

Options:

*) Create a setuid program (not shell script!) that does what you need.
*) Create a daemon program that listens for requests, changing privileges as needed.
*) http://httpd.apache.org/docs/1.3/suexec.html


All times are GMT -5. The time now is 12:18 PM.