Thursday, November 14, 2013

How to set the never expire password to the user in HP-UX and Linux?

How to set the never expire password to the user in HP-UX and Linux?

HP-UX

For trusted system:

# /usr/lbin/modprpw -m exptm=0,lftm=0,mintm=0,expwarn=0,llog=0 username

For non-trusted system:

passwd -x -1 username

This doesn't work on 11.11.


It is the same command in all HP-UX systems and you can use SAM also to do this.

SAM>>Users & accounts >> users>>username 

Select the user and go to action menu then go to modify securities policy.


Linux


/etc/shadow stores actual password in encrypted format for user’s account with additional properties related to user password.
The password expiration information for a user is contained in the last 6 fields. Password expiration for a select user can be disabled by editing the /etc/shadow file
The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.
# chage -l username
# chage -l bliu
Last password change                                    : Oct 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

To disable password aging / expiration for user foo, type command as follows and set:
Minimum Password Age to 0
Maximum Password Age to 99999
Password Inactive to -1
Account Expiration Date to -1
Interactive mode command:

# chage username

or

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

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...