I had a simple automation process to write which needed to copy a few files from linux server to windows via SSH. This can be accomplished using putty.
SSH, as part
It had been working fine with
pscp file user@dest:
but then I got the same error. So I did:
pscp -l USERNAME -pw PASSWORD FILE 10.1.1.1:
and that did the trick for me.
As of 9 Sep 2014 with the corresponding version of plink (tested with plink 0.66), you can use the -hostkey option, as documented here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/accept-host-keys.html
Using the key in the original question:
plink -hostkey cc:78:13:a3:68:a6:59:7e:b8:23:2d:13:3e:66:9b:b9 user@remote
I successfully used "-hostkey" in my scripts to get around the initial host key prompting problem.
"-hostkey" is also documented to work with pscp (version 0.66).
Note that you have to change the hostkey if you change hosts or the sshd server recalculates the key.
I was having this problem when using Bazaar, and manually setting my ssh client to be putty rather then the built in paramiko, and I was getting the exact same problem, where it was trying to say the key was not in the 'known hosts' and asking if i should verify it, but due to it being run by a different program and not in a normal terminal it just exited immediately.
If you can, just run putty and connect to the server manually to get it to save the ssh public key in the registry so when the automated program tries to connect it won't be presented with the y/n option.
Or you can use a small python3 script that i wrote to convert between the two 'known host' formats that putty and openssh use: https://github.com/mgrandi/openssh-putty-knownhost-converter
`