I am trying to automate user creation or adding of users to my squirrelmail server i have configured on ubuntu 16.0.4. I want to create a registration form using php then i want to the user it self to register him self to the mail server which is squirrelmail. simply like gmail when you first signup you should have to register your self . that is exactly what i want to develop.
when adding users into squirrelmail you have to run these commands on ubuntu
$ sudo useradd myusername
$ sudo passwd myusername
$ sudo mkdir -p /var/www/html/myusername
$ usermod -m -d /var/www/html/myusername myusername
$ sudo chown -R myusername:myusername /var/www/html/myusername
what i exactly want is to excute these commands from php script by accepting username and password from the user. Is there any way i can do these...please help me??