Chapter6 PracExer p141-142
Chapter6 PracExer p141-142
Chapter6 PracExer p141-142
Ownership
Guided exercise
In this lab, you will control default permissions on new files using the umask command and setgid
permission.
Outcomes
Create a shared directory where new files are automatically owned by the group ateam.
Experiment with various umask settings.
Adjust default permissions for specific users.
Confirm your adjustment is correct.
1. Log in as alice on your serverX virtual machine and open a window with a Bash prompt. Use the
umask command without arguments to display Alice's default umask value.
2. Create a new directory /tmp/shared and a new file /tmp/shared/defaults to seehow the default
umask affects permissions.
3. Change the group ownership of /tmp/shared to ateam and record the new ownership and
permissions.
4. Create a new file in /tmp/shared and record the ownership and permissions.
5. Ensure the permissions of /tmp/shared causes files created in that directory to inherit the group
ownership of ateam.
6. Change the umask for alice such that new files are created with read-only access for the group
and no access for other users. Create a new file and record the ownership and permissions.
8. Change the default umask for alice to prohibit all access for users not in their group.
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
9. Log out and back into serverX as alice and confirm that the umask changes you made are
persistent.