Welcome the New Crew
A new sailor, Maya, joins the ship today, and the deck crew needs a shared folder. Set everything up with sudo. Your password is student.
How it works: the terminal below is a real Linux machine running in your browser. Click it and
type. Tasks tick themselves off as you complete them; questions are answered in the box under each task.
Press Reset any time for a fresh machine. Your password on this machine (for
sudo) is student.
Hints
Check your work with id maya, getent group deckhands and ls -ld /srv/deck.
Solution explanation
useradd -m -s /bin/bash creates the account with a home and a shell, and passwd maya sets her password. usermod -aG adds a group without removing the others. chgrp hands the folder to the group, and 2775 means SGID (2) + rwx for the owner (7) and the group (7) + r-x for others (5). sudo -u maya runs the command as Maya, so the file is hers.
Show solution
sudo useradd -m -s /bin/bash maya
sudo passwd maya
sudo groupadd deckhands
sudo usermod -aG deckhands maya
sudo usermod -aG deckhands student
sudo chgrp deckhands /srv/deck
sudo chmod 2775 /srv/deck
sudo -u maya touch /home/maya/hello.txt