Operating System - HP-UX
1752720 Members
5799 Online
108789 Solutions
New Discussion юеВ

Re: How to script/cron a password change?

 
Evelyn Daroga_1
Occasional Contributor

How to script/cron a password change?

I would like to cron a script that changes the password of a particular user
each night. Is there a trick to redirecting input to the passwd command in a
shell script?
5 REPLIES 5
Steve White_8
Frequent Advisor

Re: How to script/cron a password change?

You can't use the passwd utility and redirect input to it. If you are capable
of allowing the client to do it you could write a script that forces them to
change the password at next login. You could then implement password aging on
the system.
Evelyn Daroga_1
Occasional Contributor

Re: How to script/cron a password change?

Thanks for the quick reply. I suspected as much.
However, to implement password aging, does the system have to be trusted?
Steve White_8
Frequent Advisor

Re: How to script/cron a password change?

Hi,

The password aging does not require that you convert your system to the trusted
environment. Go into sam and select the users and groups, then users, then
highlight a desired account i.e. you. Then from the actions menu, select
modify, then select password options and put what you want generically.

Then go to the /etc/passwd and see what has been placed in the password field.
This you would be capable of scripting to run where ever you want.
Evelyn Daroga_1
Occasional Contributor

Re: How to script/cron a password change?

This should be a great help! Thanks a lot for your help.
Al Langen_2
Advisor

Re: How to script/cron a password change?

Since you know the particular user, use the -f option in the crontab:
00 00 * * * passwd -f userlogin