The usermod command is used to modify user accounts on a Unix-like operating system. It can only be executed by the superuser (root) as it involves making changes to system user account information. usermod is a versatile command that allows you to change various aspects of a user account.
The basic syntax for the usermod command is as follows:Here, "USERNAME" is the name of the user account you want to modify.
Some of the commonly used options for the usermod command include:
# usermod -g sales hr ←Change the primary group of user "hr" to "sales" |
Please note that you should exercise caution when making changes to user accounts, especially when altering their UID or locking/unlocking accounts.
For more detailed explanations and additional examples of the usermod command, you can refer to the provided link.