usermod

Table of Contents

1. Groups

The /etc/group is the file that defines the groups on the system, see group(5).

Check which group(s) a user is a member of with the groups(1) command

groups alan # current login only
id alan
grep alan /etc/group

2. Add user to group(s)

Use -aG to append group bar to the list of groups the user is a member of

usermod -aG adm,sudo alan

3. Remove user alan from groups foo and bar

Use gpasswd for feedback

usermod -rG foo,bar alan

4. Related nodes

5. References