Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 8 down vote accepted

To maximize password expiration:

passwd -x 99999 username

To disable account expiration:

usermod -e '' username

To do both with chage:

chage -E -1 -M -1 username

To set the system defaults, look at /etc/default/useradd

share|improve this answer

AIX: Non expiring password

Changing user history size

chuser histsize=0 <userid>

change the users password

passwd <userid>

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`
share|improve this answer

Solaris/SunOS:

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)

https://docs.oracle.com/cd/E19455-01/806-1387/6jam6929e/index.html#a08paswd-89198

share|improve this answer

The complete command to mitigate any other previous configurations is the following:

chage -E -1 -M -1 -I -1 username
share|improve this answer

Use chage command:

chage -M -1 USERNAME
share|improve this answer

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

share|improve this answer
1  
chage has an explicit value for this behavior. See bindbn's answer for example. – Allen Nov 12 '13 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.