We have a Windows service running under the Windows Local System account by default. This service is trying to transfer the file to the server using pscp.exe. This is the exact command we run:
pscp.exe -batch -r -q -v -l **** -pw **** C:/temp/test my-server-host-name:/bnrr2p3
Note the use of the -batch option to avoid any hints. Now this fails because the server name has not been added to the list of known hosts with the following error:
Looking up host "my-server-host-name" Connecting to 10.89.3.108 port 22 Server version: SSH-2.0-Sun_SSH_1.1.4 Using SSH protocol version 2 We claim version: SSH-2.0-PuTTY_Release_0.62 Doing Diffie-Hellman group exchange Doing Diffie-Hellman key exchange with hash SHA-1 The server host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server rsa2 key fingerprint is: ssh-rsa 1024 10:a8:36:6a:be:99:2c:e0:1c:18:80:28:c8:e5:dd:9b Connection abandoned. Disconnected: User aborted at host key verification Lost connection
Google says that I need to manually log in to this server first and add this server to the list. I can do this if I run it as a specific user.
How to make it work for a Windows Local System account?
source share