Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to grant a user (username: eddie) access to all directories (with mod 770) shared by root (myself). I do it this way:

groups root
(here comes a list of groups in which root user is)

usermod -a -G group1 eddie
usermod -a -G group2 eddie
usermod -a -G group3 eddie

All the 'group1', 'group2', 'group3' are seen in the group list of root user.

However, after adding 'eddie' to all groups above (including group 'root'), he still can not write to directories shared by root user.

Did I do it wrongly?

share|improve this question
Have you logout and relogin after add paul to the different groups? – Just1602 Nov 10 '13 at 1:36
hm, it's server, i dont want to reboot, anyway i'll try rebooting and see how – jondinham Nov 10 '13 at 1:56
@Paul, you don't need to reboot a Linux server for perms to take effect. (You don't even need to log off and log back in again, its immediate) – davidgo Nov 10 '13 at 6:05
I'm unsure from your question what you are trying to do, hence I have not put this in as an answer, but might you be looking for usermod -a -G root paul (To add Paul to the "root" group). – davidgo Nov 10 '13 at 6:09
@nitro2k01 answer is good - changing the owner of the directory to eddie would be a better move - security wise. With the added information I do suspect my answer/comment is the command you were looking for - but, of-course, its not generally a good idea as it could give eddie access to more stuff then envisioned. – davidgo Nov 10 '13 at 6:39
up vote 3 down vote accepted

The owner of a file consists of two fields, one for the user and one for the group. If you do ls -l you can see the user as well as the group in the output. The group field in the file mode controls access for users in the group that owns a particular file.

It's irrelevant which groups root are in for your problem. Only the owner field for the file you want to give access to, and the other user's group memberships matter. If a file is owned by root:somothergroup and has mode 770, paul can only access that file if paul is in somothergroup.

If you want to share specific files, I'd suggest creating a group that you add eddie to and, and change the ownership of the files to that group. (e.g. chgrp -R somegroup somedirectory to recursively change the ownership of all files in that directory.)

Also, somewhat unrelated, I'd strongly discourage you from always running as root. It's generally better to use a less privileged user account for daily tasks and using sudo or su to elevate your privileges.

share|improve this answer
thank you, creating a new group for sharing is a good solution :) – jondinham Nov 10 '13 at 6:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.