I have file named abc.txt and 3 groups (Teacher, Staff and Student).
I want to create a group name CanView, which allow Teachers and Students to view the file abc.txt. Can I add Teacher and Student to CanView?
2 Answers
You have to add each user to the group CanView. You can't add a group to the group CanView.
But you could use ACL.
You can "add" them, but first you must read man adduser, man group and man vigr. On my system, I have added myself to 14 groups. I am not giving you a do this;do that style answer, because You must understand what you're doing before you do it, or learn how to recover from doing it wrong. I have tried both ways.
Once you've added them to the group file, they must either logout/login to apply the new group membership to the session, or use newgrp CanView to spawn a single shell with the new group membership active..