Linux Ubuntu 14.04.1 File Permissions

Hi, im really new to Linux permissions so I would appreciate help with this simple query.

Ubuntu 14.04.1

I have 2 users root and user1

I have a directory /var/www/html/gallery

The directory is empty

I would like to create a new group add root and user1 to that group and make that group have read, write and delete permissions, (FULL), to the directory, /var/www/html/gallery

Can someone please help me ?

Thank you.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can create a new group with the command:

sudo addgroup groupname

You can then add your user to that group with:

sudo gpasswd -a user groupname

Finally, you can give that group permissions to the folder with:

sudo chown -R :groupname /var/www/html/gallery
sudo chmod g+wx /var/www/html/gallery

For more information on modifying permissions, check out: