Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem automating pscp.exe on my server

Status
Not open for further replies.

elpico

Programmer
May 14, 2003
19
0
0
GB
Hi all,

I've set up a couple of scripts to update various password files on my windows 2000 server. These files are updated using new files from my unix box, and I've been trying to use secure putty (pscp.exe) to automate the transfer.

The problem I've been having is that my script is supposed to be run every night, but the initial connection is awaiting user input - I need to automate the user input, but can't seem to get it running.

The message its coming up with is the following:

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's key fingerprint is:
1024 7b:17:22:67:de:a8:e7........
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)


I need to automatically input the answer "y" into the script, but it doens;t seem to like anything I do.


I run the command in a batch script as follows:

pscp -P 670 user@server:/opt/visaeu/etc/.win_exp_pwd .

but if I try to send input with the < command it always fails. Anyone know how I can automatically include answer &quot;y&quot; as part of the script?

Cheers,
K.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top