0

I am a Linux newbie and I am trying to create some groups in my system. I use Lubuntu 13.04 and my username is - say - user1; by default, during the installation a primary group called user1 has authomatically been created for my account. I created later user2 and its primary group called user2; then I created another group, users, which I added as secondary group for both user1 and user2 with the commands

sudo usermod -aG users user1
sudo usermod -aG users user2

Now there are two questions:

1) Typing the command groups from the user1 prompt generates a certain output:

user1 adm dialout cdrom sudo dip plugdev lpadmin netdev

but typing groups user1 generates a different output:

user1 : user1 users

Why?? Shouldn't they produce the same output?

2) user1 can access the user2 home directory, in /home/user2; but user2 can't access /home/user1! Althout having different owners, both the directories has permissions like this:

drwxrw-r--

So, why is not /home/user1 at least accessible (even if not writeable) from the user2 prompt? Thank you and sorry for my... newbyness!

Bob

migrated from stackoverflow.com Dec 11 '13 at 3:59

This question came from our site for professional and enthusiast programmers.

0

Your description and question lacks some necessary information to give a definite answer.

But I'll try loosely based on your description, user1 was created under the group user1 and wasn't in group users until you added it. Having said this, its home directory will be group owned by user1 and not users. Under the assumption that the directory is group readable and not world readable, only users belonging to user1 group will be able to read user1's home directory.

A read permission for a directory allows listing its contents. An execute permission for a directory allows traversing (cd pushd) it.

Listing the groups without parameter will print the effective groups of the current process, not the current user, while listing groups with parameter (user) will print the groups the user belongs to.

  • Your interpretation is correct. /home/user1 is group owned by user1 and just adding the x permission to the "world" user2 can view inside /home/user1. – BowPark Dec 10 '13 at 23:26

Your Answer

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

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