The group triple works for members of the file's group. If the file has the wrong group, that is what you change: permissions cannot fix it.
chown, from the same article, changes the owner and the group: sudo chown user:group file. Just the group: sudo chown :group file. Only root can give a file away, so chown usually runs through sudo. chown leaves the permissions alone, and chmod leaves the owner and group alone.
You test a colleague's write as the colleague. tee -a file appends the line it receives to the file, and through sudo -u it runs as the colleague:
Let a colleague into the report
Your colleague labpeer from the lab-editors group must read and append to /srv/permissions-lab/report.txt. The file's owner is student and stays so; others get no access, and the text must not be erased.
Goals · 0 of 3
- Give the file to the lab-editors group, keeping student as owner not done yet
- Give the group read and write, and others nothing not done yet
- Keep the report's text not done yet