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?

  • 1
    "ask" or "add"? – muru Sep 21 '15 at 2:00
  • Add, I fixed after your comment – Andiana Sep 21 '15 at 9:05

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.

| improve this answer | |

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..

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.