apache user cannot execute useradd via sudo :(
| From: | vuthecuong | Date: | Fri, 22 May 2009 11:35:21 +0000 |
| Subject: | apache user cannot execute useradd via sudo :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-292926@lists.php.net to get a copy of this message | ||
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:
%apache ALL=(ALL) NOPASSWD: ALL
%tony ALL=(ALL) NOPASSWD: ALL
My test.php í:
<?php
$username="hixhix";
system("/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M
$username",$returnvalue);
echo "return value: $returnvalue";
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.
--
View this message in context: http://www.nabble.com/apache-user-cannot-execute-useradd-via-sudo-%3A%28-tp23668764p23668764.html
Sent from the PHP - General mailing list archive at Nabble.com.