adding Linux users from php
can you please tell a way to add linux user from a php script ? I am trying system and exec ...but I am not able to do.. please tell me if its possible or not ? and als开发者_Go百科o if possible share the code snippet :)
thanks
You could do that, but not in a simple way which is also secure and easy. PHP and Apache will never allow you to execute system commands out of the box, not to mention root stuff!
So you will need to study that, create some wrapper scripts which will be able to receive parameters from PHP (to know what to do, get the username and password of the new user, etc...) elevate their privileges (hint: look at sudo or SUID), and then run your command...
精彩评论