I have created a group for developers, to give them access to: /var/lib/dev, a folder which already have some folders and files inside.
The commands I've introduced are:
$ sudo useradd -d /var/dev -M -r devmaster
devmaster is a new system user with primary group
devmaster. That can be checked out with
$ id devmaster uid=998(devmaster) gid=998(devmaster) groups=998(devmaster)
Then, I changed permissions (using
chown) as follows:
$ cd /var $ sudo chown -R root:devmaster dev $ sudo chmod -R o-wrx dev $ sudo chmod -R g+wrx dev
And finally (my username here is just
$ sudo usermod -G devmaster justme $ id justme uid=1000(justme) gid=1000(justme) groups=1000(justme),998(devmaster) $ ls -lh // Omitted drwxrwx--- 3 root devmaster 4,0K dic 12 19:48 dev // Omitted
But if I try to go into the directory:
$ cd dev -bash: cd: dev: Permission denied
What's wrong with me?