Can I add a user group to another group in Ubuntu?

14,694

Solution 1

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.

Solution 2

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

Share:
14,694

Related videos on Youtube

Andiana
Author by

Andiana

Updated on September 18, 2022

Comments

  • Andiana
    Andiana over 1 year

    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?

    • muru
      muru over 8 years
      "ask" or "add"?
    • Andiana
      Andiana over 8 years
      Add, I fixed after your comment