Redhat: Modify user

From Define Wiki
Jump to navigation Jump to search

Usermod

Once a user is created various setting may need to be updated or changed. This is done with the usermod command.

usermod -e 2013-06-08 <username> #change the expiration date
usermod -G <group> <username> #add user to group
-aG <group> appends to exisiting group
-l <new username> set new username
-L Lock Password
-U Unlock Password

Groupmod

The groupmod command only as two practical uses: change the group ID or change the group name.

groupmod -g <newid> <groupname>
groupmod <oldname> <newname> #chnage the grouop name

chage

The chage (change age) command is used to modify the age information of a password.

-d <date> Set the last change date for the password
-E <date> assign an expiration date
-I <num> Locks account num days after password expiration
-l lists aging information
-m set minium days user must keep password
-M <num> set maximum number of days user can keep password
-W <num> specifies days before expiration that the user is warned.