I am trying to write a PHP script which executes a shell command (via system()?) to add a new user to the server. I am thinking about using useradd or adduser but don't know how I will get it to work. What flags are necessary to execute useradd in a script? And how would I set the permissions on the script so it executes properly? This doesn't work:
<?
$user = $_GET['user'];
system("sudo useradd -m -p 4dk/kBWvKaP52/POJYOZGLam8qZnCkQtdw== $user; echo $user");
?>
$user? What should theechodo?$useris a GET variable. Echo is just for testing purposes.