What is the easiest way to check when a user's password will expire and send a notification email? On Linux, I can use chage command to get "Password expires" date. But on AIX, lsuser command gives me maxage, but that doesn't tell me when it will expire.
The password for our db2 user ids is set to expire every 90 days on some AIX/Linux servers. We don't login using db2 id (sudo from our personal id), so we don't get notified that it will soon expire. When the password expires, crontab jobs for db2 stop running.
Can you please suggest something I can use for both AIX and Linux? Preferably, something that I can run without using root.
What I'd like to do is to automatically reset the password, it doesn't matter what it gets reset to since we don't really need to know it. I found chpasswd command that I could use on AIX/Linux, but it looks like it requires root. Is there anything available on AIX/Linux that will allow a regular user id to reset its own password other than changing it with passwd?
The chmod command has a -s option that allows the program/script to be executed as if it were run by the owner of the script rather than the login name of the user. If you were to do this, you should put the script in a directory that few people have access to.
Yes. (very guardedly). There should be very few members in the group that can execute this script.
Do you know if 'chpasswd' takes its input from stdin or stderr. You can test this simply by creating a file with a password in it (twice if chpasswd asks twice) and running it as:
where data contains
If chpasswd does not use stdin then you have to write a script using expect.
Try this with a test account, or have two open sessions so that you can restore the password if the change works, or worse changes the password to something with a carriage return in it.