I have my local user localUser who has directory /home/localUser. There is another user serviceUser who runs some services and he needs full access to some folders in my home directory.

I want to create group serviceGroup and add serviceUser there. Then I want to give full access to home/localUser/workingFolder folder.

How to do that?

  • You should edit your question: define what you mean with "full access".
    – pefu
    May 14, 2015 at 13:48

3 Answers 3

  • Assuming one user will be the user the /home is created for:

    -- That user would have ALL Permissions by default, as for the others create the users and then add them to the Original users' GROUP

    -- Then make sure the GROUP has 777 permissions

    sudo groupadd serviceGroup  ## Creates the needed group

    sudo useradd serviceUser  ## Adds the service tech user account

    sudo usermod -a -G serviceGroup serviceUser  ## Adds service Account to the service group 

    sudo chmod -R 777 $serviceGroup  ## grants  full access to the serviceGroup members 

    sudo chown -R localuser:serviceGroup /home/localuser  ## owner stays  localuser but  anyone in the serviceGroup "group" has access to its full  contents
  • I edited the question. May 14, 2015 at 10:06
  • chmod: missing operand after ‘777’ Try 'chmod --help' for more information. May 14, 2015 at 10:17
  • still getting that error May 14, 2015 at 10:19
  • $serviceGroup is a variable that is not defined…
    – slhck
    May 16, 2015 at 17:33
  • I would replace sudo chmod -R 777 $serviceGroup with something like chmod -R g+rwx /apps from askubuntu.com/a/488491/48214
    – Ryan
    Jul 11, 2018 at 17:37

This answer teaches you how to fish.

  1. You want to use the useradd (or adduser on Debian) command to create the serviceUser.

  2. You want to use the groupadd (or addgroup on Debian) command to create the serviceGroup.

  3. You want to use the usermod (or adduser on Debian) command to add serviceUser user to the serviceGroup group.

  4. You want to use the chgrp command to change the group of workingFolder.

  5. You want to use the chmod command to change the rights for the group to allow read, write and execute access.

  6. You want to use the man command to get the required detail info to perform the exact actions.

  7. Start with the man man command.


Check also permissions of /home. At least it should have execution permissions for all:

chmod 755 /home
  • I disagree. If that were the case there would 1) be no need for a ServiceGroup and 2) assuming enterprise as the question was worded (even tho holds true for home user but to lesser degree) would degrade security. Jul 13, 2018 at 1:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .