Thursday, October 15, 2009

User password expiration


Like in AIX, on Linux it is important to control the users passwords expiration.  The password expiration information is stored in /etc/shadow.

Inspect the password expiration from one user:

# chage -l simpleuser
Minimum:        0
Maximum:        90
Warning:        7
Inactive:       -1
Last Change:            Feb 19, 2009
Password Expires:       May 20, 2009
Password Inactive:      Never
Account Expires:        Never

Inspect the password expiration from all the users:
for i in `cat /etc/passwd | awk -F: '{print $1}'`; do echo "UserName:${i}"; chage -l $i|grep "Password Expires" ;done

Disable the password expiration from one user:
# chage -I -1 -m 0 -M 99999 -E -1 simpleuser

1 comentarios:

Mohit Gupta said...

hello frnd. nice work done by u on ur blog. hay i wanna link exchange with u if u r interested.mine blog address is www.hakingtips.blogspot.com
waiting for ur reply.mail me at mohit.gupta700@gmail.com