Its possible that sometime in your short, meaningless life, you may need to create an account that has a password that is set to never expire. This is somethimes the case with headless accounts and specialty accounts such as the type you might have to setup for monitoring or security scanning. You might also find yourself setting up shared headless accounts that have locked passwords in order to block direct logins. This second scenario can be especially troublesome when this is some sort of application or database user with cron jobs, as even an account without a password and expire and lock. If this occurs all of a users cron jobs will fail. All because the account expired.
So today we are going to configure a user password not to expire.
Lets start with Solaris. First lets unlock the account just in case.
passwd -d username
Now you can turn off password aging for a user with the command below.
passwd -x -1 username
You can then verify your config with the following.
passwd -s dmadmin
The output of the command above should look similar to what I have below. In this example our user id is myuser.
#passwd -s myuser myuser PS
Compare what you see above to the output below for our example myuser1, which includes the date that the password was last changed, the minimum number of days between password changes, the maximum number of days required between password changes, and the number of days of warning a user is given before a password expires. Standard system password aging and expiration still applies.
#passwd -s myuser1 myuser1 PS 09/30/13 7 28 7
Now lets move on to Linux. First lets ulock. Then we will configure the password to not expire. Then we can verify our work with the chage -l command.
passwd -u username
chage -m 0 -M 99999 -I -1 -E -1 username
change -l username
So now lets take a visit to AIX land. Remember to not stay long. Again, its always best to make sure that the current password is not locked. Then we configure the password to not expire. Finally we step back and admire our work.
chuser account_locked=false username
chuser maxage=0 username
lsuser -f USERNAME | fgrep expires