LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   SUDO Problems (http://www.linuxquestions.org/questions/linux-security-4/sudo-problems-211696/)

da_tibmeister 07-30-2004 09:50 PM

SUDO Problems
 
I need to configure the sudoers file so that user apache has access to the adduser script, and can run it. Yep, you read it right, I have a PHP page that needs to have the ability to add users to the system. Gotta love it, eh?

anyhew, here's what I have:
apache ALL = NOPASSWD: /usr/sbin/addusers

Well, either this don't work or somehow I need to reset sudo to re-read this file.


Thanks

kadaver 07-31-2004 10:30 AM

well, the command is called adduser, not addusers..
/usr/sbin/adduser

da_tibmeister 07-31-2004 10:49 AM

Yes, typo on my part. My issue is I'm getting a password prompt, even though I put in the NOPASSWD: option, and this just won't work from a PHP page...

shubb 08-03-2004 05:42 PM

This may seem like a dumb question, but are you running apache as the user apache? I am also running slack 9.1, and by default, when root starts apache it starts the sub-processes that run as user nobody. So, unless you changed it to run as user apache, that may be the problem.

Presuming you have created the apache user and thats not the problem, can you log in as the apache user and use the sudo command? I think that it may ask you for a password the first time you try to sudo, even if NOPASSWD is set. After that, it should not prompt again.


Also, on another note, you may want to use the useradd, instead of adduser. adduser asks for the information, whereas useradd allows you to specify the options on the command line.

da_tibmeister 08-03-2004 07:54 PM

Well, got the sudo problem gifured out, now to figure out the password problem, because with adduser, you have to pass the -p argument a pre-encrypted password.. Hmmm....

Obie 08-03-2004 08:01 PM

Correct me if I am wrong. Shouldn't you run the command useradd as opposed to adduser. I know adduser works but useradd seems to offer more options to my knowledge. Also when prompted for a password, are you being prompted to access the page or being prompted to add a password for the user you are adding. By default useradd doesn't require a password string since it assumes you may run passwd.


All times are GMT -5. The time now is 02:11 PM.