sudo useradd -d /var/www/html -G apache vpsiedemo
After creating set one password.To set it run this command:
sudo passwd vpsiedemo
If you want to modify one existing user run this command:
sudo usermod -a -G apache vpsiedemo
To set the group run:
sudo chgrp -R apache /var/www/html
To set the permissions run:
sudo chmod -R g+w /var/www/html
sudo chmod g+s /var/www/html
sudo useradd -d /var/www -G www-data vpsiedemo
To set password is same as in CentOS, Fedora, and RHEL.
sudo passwd vpsiedemo
If you want to modify one existing user run:
sudo usermod -a -G www-data vpsiedemo
To set the group run:
sudo chgrp -R www-data /var/www
And to set the permissions run:
sudo chmod -R g+w /var/www
sudo chmod g+s /var/www
You have successfully Add a Linux User With Document Root Permissions.
Enjoy!