Linux modify user group method

  

usermod -g user group user name Set a user's group usermod -G user group user name Change a user to group(s) usermod -a -G user group user name Add users to a group (s)

Attach usermod instructions:

Description: Modify user accounts.

Syntax: usermod [-LU][-c <Remarks>][-d <Login Directory>][-e <Validity Period>[-f <Buffer Days> ;][-g <group>][-G <group>][-l <account name>][-s <shell>][-u <uid>][user Account]

Note: usermod can be used to modify the user account settings.

Parameters: -c<Remarks> Modify the comment text of the user account. -d login directory> Modify the directory when the user logs in. -e<expiration date> Modify the expiration date of the account. -f<buffer days> Modify how many days after the password expires, close the account. -g<group> Modify the group to which the user belongs. -G<Group> Modify the additional group to which the user belongs. -l<account name> Modify the user account name. -L Locks the user password to invalidate the password. -s<shell> Modifies the shell used by the user to log in. -u<uid> Modify the user ID. -U Unlock the password.

Copyright © Windows knowledge All Rights Reserved