I came across the following task:
Add 3 new users - alice, bob, charles
- Create a new group - marketing - and add alice, bob and charles to that group
Create a directory - /marketing - whose owner is alice and group is marketing
Set appropriate permissions so that the marketing group can share documents in the new directory but nobody else can see the documents.
Give charles read-only permission.
Create an empty file in /marketing named "empty".
Here is my answer:
- useradd alice
- useradd bob
- useradd charles
- mkdir /marketing
- chown alice:marketing /marketing
- chmod g=rwx,o=x /marketing
- setacl -m u:charles:r d /marketing
- touch /marketing/empty
I guess I got everything right except to give charles only read permissions.
As you can see in my answer I did using acls, however, since charles is also the marketing group, i believe it ignores the acls, because I switches to user Charles and I was able to create a file in /marketing.
That makes me question if the task itself doesn't make sense!
or do i have to remove charles from the marketing group?