How to modify a Linux user using usermod command
The usermod command can also be used to modify options for an existing user with the usermod <options> <username> command. Most of the useradd options from the above table can be used with usermod. Some of the additional options are given in the below table.
Option |
Description |
-l <loginname> |
Change the user’s username to <loginname>. You should consider changing the user’s home directory and name of the user private group to reflect username change. |
-L |
Lock the user. User can no longer log in to the system with the old password. |
-U |
Unlock the user’s password so the user can log in to the system again. |