O'Reilly logo

Practical Linux by Bill Ball, John Ray, Michael Turner, M. Drew Streib

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required