开发者

Adding a user (useradd) via PHP - Ubuntu

开发者 https://www.devze.com 2023-02-22 08:58 出处:网络
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\'];

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

精彩评论

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