Knowledge Base:Adding a user to a group

Synopsis
This article describes how to add a Linux user (account) to a group

Environment
Any Gentoo Linux environment not using a centralized account management tool (like LDAP).

Analysis
Unless defined otherwise, groups and group membership is managed through the  file. Some systems have accounts managed through a centralized resource (such as an LDAP directory). The  file defines where the system looks for group membership.

When using a centralized user repository, the resolution given below might not work.

Resolution
Although you can directly edit, it is much easier (and less error prone) to use the gpasswd command.

For instance, to add the user "lacy" to the "wheel" group: