Linux Ubuntu 14.04.1 File Permissions

Posted February 16, 2015 3.4k views

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.

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.

Submit an Answer
1 answer

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:

by Justin Ellingwood
In this article, we will discuss how to read and manipulate Linux permissions. We will cover how to use the "umask" command to choose default permission settings, and the "chmod" command, which can change the permissions of files and directories.