I freely admit this is homework:
Imagine you and your friend host an IT faculty in your former school. The list of attendees is in the attached text file. You need to manage permissions for directories
solutions. Write a script that creates accounts for all attendees and sets permissions in such a way that:
- Every attendee has the right to read files that will be created in the directory
documents, while your friend has the right to read and modify files from this directory, but can't add or remove anything;
- Every attendee has the right to read files that will appear in the directory
tasks, while your friend has all rights to this directory;
- Every attendee has the right to place their solutions in the directory
solutions/<ID of attendee>-<ID of task>;
- Your friend has all rights to the
solutionsdirectory tree, while the attendees can't see the solutions of their peers.
This is homework from basic file permissions (
umask) and ACLs (
Now this is what perplexes me:
We have to set fine-grained permissions for files that are not yet present but will be created in the future?!?!
To my understanding:
umaskallows us to set default permissions for newly created files; but these are only the basic owner-group-others permissions, so I can't really differentiate my friend's permissions with attendees' permissions with attendees' peers' permissions;
setfaclONLY allows me to set permissions for files that already exists or I create, but NOT files that will be created in the future!
So I'm ignorant on how to do this homework. Can someone show me the right track?