Removing Users from a Group and Deleting a Group
| Chapter 5. Using Groups |

## Removing Users from a Group and Deleting a Group

You can use the following commands to remove groups and their members:

- To remove a user from a group, use the pts removeuser command

- To delete a group entirely, use the pts delete command

- To remove deleted groups from ACLs, use the fs cleanacl command

When a group that you created is deleted, your group-creation quota increments by one, even if you no longer own the group.

When a group or user is deleted, its AFS ID appears on ACLs in place of its AFS name. You can use the fs cleanacl command to remove these obsolete entries from ACLs on which you have the a (administer) permission.

### To Remove Members from a Group

Issue the pts removeuser command to remove one or more members from one or more groups. You can always remove members from a group that you own (either directly or because you belong to the owning group). If you belong to a group, you can remove members if its fifth privacy flag is the lowercase letter r; see Protecting Group-Related Information. (To display a group's owner, use the pts examine command as described in To Display A Group Entry.)

       % pts removeuser -user  <user name>+  -group <group name>+

where

-user

  Specifies the username of each user to remove from the groups named by the -group argument.

-group

  Names each group from which to remove users.

### Example: Removing Group Members

The following example removes user pat from both the terry:team and terry:friends groups.

       % pts removeuser  pat -group terry:team terry:friends

### To Delete a Group

Issue the pts delete command to delete a group. You can always delete a group that you own (either directly or because you belong to the owning group). To display a group's owner, use the pts examine command as described in To Display A Group Entry.

       % pts delete <user or group name or id>+

where `user or group name or id` specifies the name or AFS UID of each user, or the name or AFS GID of each group, to delete. If identifying a group by its AFS GID, precede the GID with a hyphen (-) to indicate that it is a negative number.

### Example: Deleting a Group

In the following example, the group terry:team is deleted.

       % pts delete terry:team

### To Remove Obsolete ACL Entries

Issue the fs cleanacl command to remove obsolete entries from ACLs after the corresponding user or group has been deleted.

       % fs cleanacl [<dir/file path>+]

where `dir/file path` name each directory for which to clean the ACL. If you omit this argument, the current working directory's ACL is cleaned.

### Example: Removing an Obsolete ACL Entry

After the group terry:team is deleted, its AFS GID (-286) appears on ACLs instead of its name. In this example, user terry cleans it from the ACL on the plans directory in his home directory.

       % fs listacl plans
       Access list for plans is
       Normal rights:
         terry rlidwka
         -268 rlidwk
         sam rliw
       % fs cleanacl plans
       % fs listacl plans
       Access list for plans is
       Normal rights:
         terry rlidwka
         sam rliw

Creating Groups and Adding Members |  | Changing a Group's Owner or Name