Posted: 2016-04-07 19:12
Hoping this is an easy one, I spent the better part of yesterday and this morning trying to figure it out without any luck.
I have a Windows 2008 server with WinSCP 5.7.3 installed and I am trying to connect via WinSCP to a Redhat Linux 5 server. I am trying to automate downloading a file from the Redhat Linux 5 server to the Windows 2008 server. So far I have only been able to get this to work via username and password in my script, however I would like to get it to work using private key authentication.
I generated a private key on my Windows Server and added the public key to my Linux server in my known_hosts file. There are other working entries in that file, so I don't think the problem is with that file. When I run the following script I get a "Server refused our key" error. I am confused, is it the Windows server refusing the linux servers public key, or the linux server refusing the windows servers key?
open sftp://brg3@XXX.XXX.X.XX:1855/ -privatekey="C:\Program Files (x86)\WinSCP\private.ppk" -hostkey="ssh-rsa 2048 34:1e:50:b7:2a:88:6f:a1:c0:3f:c1:c0:83:b1:b2:b5"
The private.ppk file is in Putty format. I have tried converting to both ssh.com and Openssh without any real luck. Here are my logs from WinSCP
***EDIT*** - Nevermind, I was not putting the key in the Authorized Keys file. I had it placed in a Known_Hosts file. Once I put it in the Authorized_Keys file it worked perfectly. Sorry
You can post new topics in this forum
And it's free!