<?php $groupname = ""; $username = ""; $password = ""; $home = ""; // /var/www/$username function createUser($groupname, $username, $home, $password){ exec("mkdir " . $home); exec("useradd " . $username); exec("groupadd " . $groupname); exec("passwd " . $username); exec("gpasswd -a " . $username . "" . $groupname); exec("chown –R " . $username . "" . $home); exec("chgrp -R " . $groupname . "" . $home); exec("chmod -R g+rw " . $home); exec("usermod -d " . $home . "/ " . $username); exec("service vsftpd restart"); } function removeUser($username, $home){ exec("userdel " . $username); exec("rm -rf " . $home); } function editUser(){ $UserFtpName = "testuser"; $UserFtpPass = "12345678"; $output = array(); exec("ssh -t user@192.168.1.10 echo " . $UserFtpName . ":" . $UserFtpPass . " | /usr/bin/sudo /usr/sbin/chpasswd",$output,$status); if ($status == 0) { // Success - password changed echo 'Password changed. - '; } else { // Password failed echo 'Password change failed. - '; } var_dump($output); } ?>
Dear immortals, I need some wow gold inspiration to create.