Open the terminal and log in as root or use sudo for administrative privileges.
Add a new user (replace "newuser" with your desired username):
bash
sudo adduser newuser
Set a password for the new user:
bash
sudo passwd newuser
Create a new group specifically for users with access to /var/www/html:
bash
sudo addgroup webgroup
Add the user to the webgroup:
bash
sudo usermod -aG webgroup newuser
Change the ownership of the /var/www/html directory and its subdirectories
to the webgroup:
bash
sudo chown -R :webgroup /var/www/html
Adjust the directory permissions to allow the group to read, write
and execute:
bash
sudo chmod -R g+w /var/www/html
Change user's home directory to the web resources folder for ease of sftp and ssh
access for web dev
sudo usermod -d /var/www/html -m newuser