Changing User and Group Ownership

Linux provides two programs to help you manage user and group ownership from the command line. The first, gpasswd, allows you to administer a group with relative ease. chgrp, the second program, allows users to change the group of particular files.

Managing Groups with gpasswd

To add users to an existing group, log in as the root user and enter the following command:

[root@insocoxygen /root]# gpasswd -a loginname groupname

where loginname is the login name of the user you want to add to the group groupname.

For example, to add the user vector to the group ittf, you would use the command

[root@insocoxygen /root]# gpasswd -a vector ittf

To remove a user from an existing group, log in as the root user and ...

Get Practical Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.