Automatic script to change the UNIX Password

Hi,

we have around 50 users and every month we need to change the password manually once its expire.

do we have any script to change the password automatically.

OS -HP-UX

Thanks in advance..

Do you mean that you personally have 50 user accounts, or you have 50 users and you want to force their accounts to change? There are settings in the OS that will force account password expiry so they will have to pick a new one next time they log in, however FTP will fail until a valid password change has been completed.

There are parameters that you can set through sam for this sort of thing, but I can't remember where the file is that stores them.

Can you explain what you are trying to achieve?

Robin

Hi Robin,

we have one server, in that we have more than 20 users.
we are trying to do the password change for all the users before its getting disable.

like we are trying to crate the automatic password script that we can configure in crontab in each user.

so we might not end up in password expired situation.

Thanks
Manivasagam

So when the password expires, does it not prompt for a new one? What happens at next login? Surely the user is prompted for a new password then because you have set it for them.

If you are looking to automate a new password setting, how will the user know their password? E-mail perhaps? Well, that's open to attack, snooping etc. so I would avoid it.

What are the password ageing settings you currently have in place? Are you actually expiring the user account rather than the password perhaps?

Let's have a think.

Robin

Once the password expires it will ask for new password when the user logging next time and he can able to change.

The issue is our user account is getting locked if someone change the password to other password.

So we are planning to change the password automatically before it expires.

passwd

1) the above command will ask for old password
2) then this will ask for new password
3) confirm the new password.

4) again we need to type passwd command to do the password change
5) and need to set to old password

we are planning to autoamte the same in UNIX shell scriping and planning to place the same in crontab of each user with some time period (may be 55 days once)

so that password will get changed before it expires and hope no one will try to change the password.

Do you think is there anyway to automate such scenario - your suggestion please ?

Why not simply use passwords that dont expire then?

Dear Manivasagam,

Does this mean that you have several people sharing a user account? If so, I could see that if one user changes the password and the others don't find out then they could suspend the account. You could issue them with their own account each to get past that one. If they really really really need to share the account, you could write a sudo rule that allows them to switch user to it and code their .profile to do so, then exit on the return. It would also give you some logging of who is using the system.

If these are already individual accounts, I'm a bit confused why if the user chooses their own when the password naturally expires, that it locks. Do they just not remember that they have changed it?

Can you explain more what is actually happening?

Robin