5

I was trying to experiment with users, groups, and permissions. The results can be seen below:

vagrant@cats:/$ ls -l | grep home
drwxr-xr-x   5 root    admin    4096 Sep 28 05:49 home
vagrant@cats:/$ cat /etc/group | grep "^admin"
admin:x:1002:vagrant
vagrant@cats:/$ cd home
vagrant@cats:/home$ pwd
/home
vagrant@cats:/home$ cd ..
vagrant@cats:/$ sudo chmod 770 home
vagrant@cats:/$ ls -l | grep home
drwxrwx---   5 root    admin    4096 Sep 28 05:49 home
vagrant@cats:/$ cd home
-bash: cd: home: Permission denied
vagrant@cats:/$ ?

I don't understand why I can't get in. The user vagrant is in the group admin, the group admin owns the directory home and only the owner and or group members can read, write or execute files in home. But for some reason I'm locked out. What am I missing here?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
mbigras
  • 3,100
  • You can find this link helpful http://ryansechrest.com/2014/04/unable-set-permissions-within-shared-folder-using-vagrant-virtualbox/ – Echoes_86 Sep 28 '16 at 07:52

1 Answers1

12

If you have done changes to your user (adding or changing groups etcetera), you need to log out and then in again for them to take effect. Or you can change to your own user in a subshell (su vagrant) and try again.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255