Using Linux Terminal 3.6: Ownership and permissions
A shared group directory with setgid and the sticky bit, private files in octal, and finding setuid programs.
Before you start
Work as root (sudo -i) for tasks 1 and 3, and as student (sudo -iu student) for task 2. Write answers to the files in /root/lab-answers/.
The lab creates users ana, ben and student (password Lab-Pass-1),
and checks that /srv/finance and group finance don't exist yet;
le-lab reset removes them.
Tasks
- Create
/srv/financeowned by root and the groupfinance(create the group, withanaandbenas its members), where members can create and edit files, new files belong tofinance, members can't delete each other's files, and others have no access.ls -ld /srv/financeshowsdrwxrws--T root finance(mode 3770). - As
student, make~/privatea directory only you can enter, and~/private/notes.txta file only you can read and write, using octal. - List every setuid file on the root filesystem, find the one that lets
users change their own password, and write its full path to
/root/lab-answers/3.
Hints
groupadd,usermod -aG(orgpasswd -a);chown root:finance,chmod 3770. Test withsu - ana -c 'touch /srv/finance/a'andsu - ben -c 'rm /srv/finance/a'.chmod 700,chmod 600;stat -c '%a %n'.find / -xdev -perm -4000 -type f 2>/dev/null;ls -lshows thes.