Input password in script

Input password in script

Post by kamin » Thu, 10 Jan 2002 01:24:16



Dear all,

    My computer have many AIX SP UNIX servers needed to install a software.
The installer of the program required to input a initial password. In order
to speed up the installation, I want to write a script to accomplish this
task. However, I found that I cannot input a password to the install program
inside the script.

i.e.

install << EOF
option1
option2
...
initial_password
optionn
EOF

The script always stop at the "initial_password line. Do any one have idea
how to input the password to program inside the script?
For a simple reproduction of the case, we may try this script

passwd << EOF
old_password
new_password
new_password
EOF

Thanks a lots!
Henry Chui

 
 
 

Input password in script

Post by Chuck Dillo » Thu, 10 Jan 2002 01:51:02



> The script always stop at the "initial_password line. Do any one have idea
> how to input the password to program inside the script?

See http://expect.nist.gov/

-- ced

--
Chuck Dillon
Senior Software Engineer
Accelrys Inc., a subsidiary of Pharmacopeia, Inc.

 
 
 

Input password in script

Post by Barry Margoli » Thu, 10 Jan 2002 01:50:35




>For a simple reproduction of the case, we may try this script

>passwd << EOF
>old_password
>new_password
>new_password
>EOF

The passwd program reads the password from /dev/tty, not standard input.
You'll need to write an Expect script to do what you want.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Input password in script

Post by Tinti » Thu, 10 Jan 2002 05:58:33



Quote:> Dear all,

>     My computer have many AIX SP UNIX servers needed to install a
software.
> The installer of the program required to input a initial password. In
order
> to speed up the installation, I want to write a script to accomplish this
> task. However, I found that I cannot input a password to the install
program
> inside the script.

> i.e.

> install << EOF
> option1
> option2
> ...
> initial_password
> optionn
> EOF

> The script always stop at the "initial_password line. Do any one have idea
> how to input the password to program inside the script?
> For a simple reproduction of the case, we may try this script

> passwd << EOF
> old_password
> new_password
> new_password
> EOF

This is a VFAQ
 
 
 

Input password in script

Post by Villy Kru » Thu, 10 Jan 2002 17:04:30


On Tue, 08 Jan 2002 10:51:02 -0600,


>> The script always stop at the "initial_password line. Do any one have idea
>> how to input the password to program inside the script?

>See http://expect.nist.gov/

Yes, the expect package includes an expect script to do exactly that.
It might still be available in AIX package format from the Bull
archives, although I don't remember what the new name is; it used to
be www-frec.bull.com.

Villy

 
 
 

Input password in script

Post by Mark van Huijste » Tue, 15 Jan 2002 21:52:16





>> The script always stop at the "initial_password line. Do any one have idea
>> how to input the password to program inside the script?

>See http://expect.nist.gov/

>-- ced

Or you could use the AIX Tools v1.5.1 Collection
(freeware.aix.tools.rte) from the Bull site :

http://freeware.bull.net/

It contains a short program called 'chpass' (in /usr/local/lib/tools)
which will set the password for you. Remember to run the command
'pwadm -f ADMCHG <user>' if you want the user to change the password
at next logon.

Mark