1.4 KiB
1.4 KiB
Linux+ 3.3.2: Permissions, attributes and ACLs
A team directory with setgid and the sticky bit, an immutable file, and an ACL that lets one more user read a private file.
Before you start
The lab creates user pat (password Lab-Pass-1), who stands in for you
in the chapter's commands: where they say $USER or ~, use pat and
/home/pat. Group labteam, /srv/team and user acltest don't exist
yet: you create them. Try the umask commands of the chapter first if you
like; they aren't graded.
Tasks
- Create group
labteam, addpatto it, and make/srv/teama team directory: grouplabteam, mode3770(setgid and sticky, no access for others). Aspat, create a file/srv/team/mine; its group should belabteam, not pat's own group. - Create
/srv/team/lockedand make it immutable, so that even root can't delete it. Try, and look at its attributes. Leave it immutable. - Create user
acltest. Aspat, writesecretto/home/pat/acl.txtwith mode 600, and let others pass through pat's home directory (o+x).acltestcan't read the file; give it read access with an ACL, so that it can, and nobody else can.
Hints
groupadd,usermod -aG,chgrp,chmod 3770,ls -ld;sudo -u pat touch.chattr +i,lsattr.- On Ubuntu,
apt install aclfirst.setfacl -m u:NAME:r,getfacl;sudo -u acltest cat.