shanto19 Posted May 26, 2009 Share Posted May 26, 2009 Hi all My server is REHL 5 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 apache 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. Link to comment https://forums.phpfreaks.com/topic/159661-apache-user-cannot-execute-useradd-via-sudo/ Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 This is the exact same post as this. Link to comment https://forums.phpfreaks.com/topic/159661-apache-user-cannot-execute-useradd-via-sudo/#findComment-842108 Share on other sites More sharing options...
Recommended Posts