rh135-day15.pdf

(235 KB) Pobierz
RH135-Day15
Written by Razib Shahriar Rubence
Managing User Accounts:
local users information are stored in a simple file /etc/passwd. Students are advised to follow
page 107 and 108 for detail.
Command to manage users:
# useradd username   <-- to add users
# passwd username    <-- to change the password of user
# userdel -rf username   <-- to delete user with recursively removing their home and mail
directory
# id username          <-- Shows user's id
# usermod is used to modify user's information. Some important uses of usermod is as follows:
# usermod -D directoryname username  <-- change user's home directory
# usermod -S filename username   <--- change user's login shell
# usermod -G Groupname  username     <-- assign Groupname as supplementary Group of the
user
# usermod -L username    <--- Locking user account
# usermod -U username    <--- To unlock user account
Managing Password:
Password Aging Policies
By default passwords do not expires. To modify password aging for existing users, use the
chage command
# chage [options] username
-m       minimum days between password changes from last change date
-M       Maximum days between password changes from last change date
-I       Number of days inactive since password expired before locking account
-E Date  expire the account on this date (YYYY-MM-DD format)
-W       Number of days before a required change to start warnings
-l       List of settings
-d       Force users to change their password when first loging
LAB Practice:
For the user jack implement the following password aging policy:
1/2
RH135-Day15
Written by Razib Shahriar Rubence
01. Account will be expired on Dec 31st, 2011
02. Password must be changed within 30 days of last password change
03. If password doesn't change within 30days of last password change, the account will be
inactive for next 7 days.
# change -E 2011-12-31 -M 30 -I 7 jack
# chage -l jack
2/2
Zgłoś jeśli naruszono regulamin