Trouble passing HostKey in command line

Advertisement

skaterkfbs
Joined:
Posts:
2
Location:
PA

Trouble passing HostKey in command line

I am using WinSCP Version 4.1.8. I am trying to connect to an SFTP-2 server and have the host key automatically used. I would imagine that this would work quite easy if we were using a script file, but I am limited to just a command line call, not creating a extra file. Below is the command I am trying to run, but it seems to be an issue with the quotes around the open command and the hostkey.

winscp418.exe /console /command "open sftp://user:pass@server -hostkey="ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d"" "option continue on" "option confirm off" "option transfer binary" "put C:\somefile.ext /path/to/file/somefile.ext" "close" "exit"

I have tried the following methods:
hostkey=ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d
hostkey="ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d"
hostkey=\"ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d\"
hostkey=^"ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d^"
hostkey=""ssh-rsa 1024 5a:1e:d3:13:7c:1b:81e8:c2:09:7e:1e:34:a5:f1:5d""

Does anyone know of a way to get this working?
I am using Windows XP SP3.

Reply with quote

Advertisement

skaterkfbs

Sorry should have turned on echo to see what was actually happening. I moved the option commands to the beginning of the list of commands and changed the incorrect "option continue on" to the correct "option batch continue".. All seems to be working now. Thanks for you time.

Reply with quote

Advertisement

You can post new topics in this forum