apache user cannot execute useradd via sudo :(
Posted: Fri May 22, 2009 6:32 am
Hi all
My server is centos 5.1 with php 5.1.6.
In my app I want apache to add user through sudo.
My sudoers file is:
My test.php í:
However, user 'hixhix' not created by apache at all, it always returned 1.
how can I make my apache tu add user using sudo?
Please help me. I need your help.
Thanks and regards.
My server is centos 5.1 with php 5.1.6.
In my app I want apache to add user through sudo.
My sudoers file is:
Code: Select all
%apache ALL=(ALL) NOPASSWD: ALL
%tony ALL=(ALL) NOPASSWD: ALL
Code: Select all
<?php
$username="hixhix";
system("/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M $username",$returnvalue);
echo "return value: $returnvalue";
how can I make my apache tu add user using sudo?
Please help me. I need your help.
Thanks and regards.