Click to See Complete Forum and Search --> : Shell script to redirect on password change warning?


Phaete
01-18-2006, 01:44 PM
We're using a reserved Linux named user for using our barcode application. This username has a .bash_profile script that launches the app upon successful login and logs the user out when closing the app.

However, this account adheres to password expiration intervals. The users don't see the pre-expire warning, so just get locked out when it expires.

Is it possible to change the .bash_profile script to check for the password expiration warning and redirect to passwd, then back to the barcode app upon successful change or logout if unsuccessful password change?

dkeav
01-19-2006, 01:22 AM
you could use grep/cut or awk/sed utils inside of an if statement on passwd -S to check the status of the passwd when they login, you could also set the passwd with a -i so that the account is still accessible for a number of days after the password has expired 1 or 2 days is a nice number just incase no one actually accesses the machine when the password expires

man passwd explains those two options more in depth