How to create a group, add users to the group, and have that user access all folders in files in that directory?

I want to basically create a group called Staff. I want staff to be able to access the folder /home/Clients and all of the subdirectories and files inside the Clients folder.

How would I go about creating the group, and how would I create the users to be able to download and access all these files. Any help would be greatly appreciated!

2 Answers

Do the following:

  1. Add group:

    sudo addgroup staff
  2. Add user to group:

    sudo adduser mike staff
  3. Give group access to folder:

    sudo chgrp -R staff /home/Clients
  4. Set permissions on folder:

    sudo chmod -R 775 /home/Clients
  5. Make all folders subsequently created inside /home/Clients to be owned by group staff:

    sudo setfacl -dR -m g:staff:rwx /home/Clients
7

I named group of downloaders "dlers" in example. Also change user "joe" enter that group.

sudo groupadd dlers
sudo chgrp dlers /home/Clients
sudo adduser joe dlers
sudo chmod 770 /home/Clients # users not in group dlers cannot vi

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like