I'd like to set up an account on a linux server and make the account's password never expire. I'm having difficulties figuring it out with the
passwd man page. Could someone please help me out?
Turn off aging while allowing user to retain current password
passwd -x -1 username
Force user to change password at next login, and then turn off aging
passwd -x 0 username
(Hopefully this helps someone out)
You want the
chage command you just set the account minimum password to a rediculously long time like 9999999999 days.
here is a very good howto - http://www.cyberciti.biz/tips/setting-off-password-aging-expiration.html
AIX: Non expiring password
Changing user history size
chuser histsize=0 <userid>
change the users password
Clear flags that tells the OS to reset password on login (after password reset)
pwdadm -c <userid>
If you do not want to cause any commotion by editing your user history size you can use the following command to change the security file to say that the last time you reset your password is always today's date. You can export this in your
.profile file so it runs every time you log in as well.
chsec -f /etc/security/passwd -s <userid> -a lastupdate=`date +%s`
Here is a full example of chage command (Change age) about Linux expiration password: Completely disable password expiration and account:
Parameters command chage :
-m 0 : Minimum number of days for the password change. -M 99999 : Maximum number of days a password change. -I -1 : We set: "Password inactive" never. -E -1 : We set: "Expires Account" never.
The example username is: sysadmit
[root@linux1~] # chage -m 0 -M 99999 -I -1 -1 -E sysadmit [root@linux1~] # chage --list sysadmit Last password change: July 15, 2017 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 Expires password 7
Extracted from: http://www.sysadmit.com/2017/11/linux-caducidad-contrasena.html