JAEN

Linux

usermod

CautionModify a user

usermod -aG <group> <user>

Add groups with -aG (forgetting -a REPLACES all groups). -L locks, -U unlocks the account.

Examples

  • usermod -aG docker taroAdd to docker group
  • usermod -L taroLock the account

Syntax

usermod [-aG groups] [-L|-U] [-s shell] <user>

Before you run it

Omitting -a wipes existing group memberships.

Related commands

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store