23.5 Modifying or Deleting User Accounts

To modify a user account, use the usermod command:

# usermod [options] username

For example, to add a user to a supplementary group (other than his or her login group):

# usermod -aG groupname username

You can use the groups command to display the groups to which a user belongs, for example:

# groups root
root : root bin daemon sys adm disk wheel 

To delete a user's account, use the userdel command:

# userdel username

For more information, see the groups(1), userdel(8) and usermod(8) manual pages.