0

I am trying to write a shell script to reset a user password. It will accept 2 arguments, 1 old password and the new password.

I have used expect and the script works. However, my tech folks do not allow me to install expect in the production servers.

Any suggestions on how to script this?

I tried the methods suggested by this article but it does not work: http://en.kioskea.net/faq/790-changing-password-via-a-script

Wes Ong
  • 15
  • 5
  • Have you noted that the solutions found in that link are not for HP-UX but for Linux? I guess the `password` command for HP-UX will not accept the option `--stdin`. – Jdamian Dec 01 '14 at 08:25
  • Yeap I realised that as well. Just to put it out there.... – Wes Ong Dec 01 '14 at 08:40
  • You need something like `expect` to provide a pseudo-terminal for password input. If folks do not allow you to install `expect`, you could write a C program like that yourself. Would you be allowed to install such a self-written program? – Armali Jun 19 '17 at 09:05

0 Answers0