21 November 2014

Linux and AIX user non expiry and force password change at first login

In Linux, if you want to set the password for an account to never expire, here is the command:

# chage -I -1 -m 0 -M 99999 -E -1 username 


And to force a user to change his password upon first login:

# chage -d0 username


Current status of the account can be checked via chage command :

# chage -l username 
Last password change                                    : Jun 18, 2013
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7



For AIX, to set the password to non expiry and force the user to change his password upon first login:

# chuser expires=0 maxage=0 username 


To check the username status in AIX:

# lsuser -f username





No comments:

Post a Comment