开发者

adding Linux users from php

开发者 https://www.devze.com 2023-01-17 08:01 出处:网络
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..

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消