Short task: close the team folder left open to everyone
In the marketing folder left open to everyone (777) you first record the state, find and quarantine a file left by someone outside the team, give the folder to the team, remove outsiders, set setgid, verify the result with three users and report the final state. You mostly choose the commands yourself.
Level 101 · 40 min
The marketing team couldn’t share their campaign files. Someone opened the folder to everyone with chmod -R 777 as a "quick fix". Now every account on the server, the intern included, can read, change and delete these files. Someone outside the team has even left a file in it.
Your task: make /srv/teams/marketing open only to the marketing group (zeynep and ali). Team members must be able to work on each other’s files, and intern must see nothing.
This is a task: after the first step no commands are given, only the goal. You can use everything from the earlier lessons. "Just use 777" is one of the most dangerous pieces of advice on the internet: it seems to fix the problem, but it opens the door to the whole building.
What you will do in this lesson
- Survey the situation
- Record it before you touch it
- The file left from outside the team
- Quarantine it
- Give the folder to the team
- Remove outsiders
- New files belong to the team too: setgid
- Verify with three users
- Report the final state
- Short quiz
Skills you will earn
- Searching for risky permissions (find -perm)
- Recording the state before and after a change (find -printf)
- Finding odd files by owner and permission (find -user, -perm)
- Quarantining a suspicious file instead of deleting it
- Changing a file’s group (chgrp)
- Changing permissions with letters (chmod u+x, o-w)
- Setting group inheritance in a team directory with setgid (2770)
- Testing a setting as another user (su -c)
← Changing ownership: chown and chgrp · Linux quick start · Account management: useradd, passwd, usermod and userdel →
Start for free