GNU/Linux Command – USERMOD

usermod — Modify a user account
Summary :
The usermod command modifies the system account files to reflect the changes that are specified, like Home dir, password, etc. on the command line.
# usermod -d /home2/usr1 usr1 -- Create the new home Dir for usr1in /home2 & Move old Dir contents to this Dir. # usermod -e 2005-04-30 usr1 -- From 30/4/2005 the usr1 acc will be disabled. # usermod -f 6 usr1 -- After passwd expires, system will allow the user to login for 6 days with a warning to change his passwd. # usermod -g prof usr1 -- Set usr1's initial group as prof. # usermod -p $1$d8 usr1 -- Set the new passwd for the usr1 # usermod -s /bin/bash usr1 -- Set Bash as the default login shell for the usr1. # usermod -L usr1 -- Lock a user's password. # usermod -U usr1 -- Unlock a user's password.
Read: man usermod

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: