RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

usermod

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

usermod [man page] - modify a user account

2. Synopsis

usermod [options] LOGIN 

3. Frequently used options

-e, --expiredate EXPIRE_DATE
The date on which the user account will be disabled. The date is
specified in the format YYYY-MM-DD.
-L, --lock
Lock a user’s password. This puts a ’!’ in front of the encrypted
password, effectively disabling the password. You can’t use this
option with -p or -U.
-U, --unlock
Unlock a user’s password. This removes the ’!’ in front of the
encrypted password. You can’t use this option with -p or -L.

4. Examples

Lets see how we can lock account for user linuxconfig. This will add "!" into /etc/shadow for user linuxconfig. NOTE: this command requires superusers privileges.
# usermod -L linuxcofnig 

usermod - lock user account
Now we can try login with user linuxconfig and see if that works:

usermod - login test
With a -U option we can unlock account:

# usermod -U linuxcofnig 
Check if the "!" is removed from etc/shadow:
# grep linuxconfig etc/shadow | head -c 15 |  sed -e 's/$/\n/' 
usermod - unlock user account
To make account expire we can use --expiredate option. This will expire user account on 1 January 2010.
# usermod --expiredate 2010-01-01 linuxconfig 
usermod - set expire date

Share this linux post:

Submit usermod in Delicious Submit usermod in Digg Submit usermod in FaceBook Submit usermod in Google Bookmarks Submit usermod in Stumbleupon Submit usermod in Technorati Submit usermod in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download