开发者

Adding a user (useradd) via PHP - Ubuntu

I am trying to add a user to the server in a PHP script, however it's not working.

Here is my code:

$user = $_GET['user'];

system("sudo useradd -m -p 4dk/kBWvKaP5开发者_如何学JAVA2/POJYOZGLam8qZnCkQtdw== $user; echo $user");

Yes, I know how dangerous this is.


You can set the setuid bit on the script file and chown it to root so it runs as root, e.g. chmod u+s file.php.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜