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

Example

# usermod -d /home2/usr1 usr1 – Create the new home Dir for usr1 in
                          /home2 & Move old Dir contents to this Dir.

# usermod -e 2009-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.

Share
Tagged with:
 



useradd – Create a new user.

Summary

useradd creates a new user with specified options like username, home
dir, group details, password, etc …

Example

# useradd usr1 — Add new user usr1 with default settings.

# useradd usr1 -d /home2/usr1 – Create the new user’s home dir in
                                 /home2

# useradd usr1 -e 2009-04-30 — From 30/4/2009 the user acc will be
                                disabled.

# useradd usr1 -f 6 – After passwd expires, system will allow the
                       user to login for 6 days with a warning to
                       change his passwd.

# useradd usr1 -g staff -G student,lect, prof – Set his initial group
                 as staff and sublimentry group as office, lect, prof.

# useradd usr1 -p $1$d8 — Create the usr1 with the given encrypted
                           password. For No passwd, acc disabled.

# useradd usr1 -s /bin/csh – Set C Shell as the default login
                              shell for the usr1.

Share
Tagged with:
 



groupmod — Modify a group

Summary

The groupmod command modifies the system account files to reflect the
changes that are specified on the command line.

Example

# groupmod -g 600 mygrp — Change the mygrp Group ID to 600.

# groupmod -n mygrp1 mygrp — Change the mygrp name to mygrp1.

Group informations are stored in /etc/group files.

Share
Tagged with: