Non-Expiring password on Linux server

Solution 1:

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

Solution 2:

Use chage command:

chage -M -1 USERNAME

Solution 3:

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