Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Open command fails with a "Too many parameters" error when I add the -hostkey option

I cannot use the -hostkey option with the open command in a script.

Duplicate post:
https://winscp.net/forum/viewtopic.php?t=15922
Guest

Open command fails with a "Too many parameters" error when I add the -hostkey option

I cannot use the -hostkey option with the open command in a script.

When I try like this:

winscp.com /command "open sftp//username/password@ipaddress -hostkey ""ssh-rsa 1536 XX:XX:XX:XX:XX:XX:XX:XX:XX""" "get xxx" exit

I get the following error:

Too many parameters for command 'open'

I get the same error when I tried rearranging and placing the -hostkey option first, like this.

winscp.com /command "open -hostkey ""ssh-rsa 1536 XX:XX:XX:XX:XX:XX:XX:XX:XX"" sftp//username/password@ipaddress" "get xxx" exit

The exact same command like works without the -hostkey value, but only from my interactive session where I have the key stored. However, I need this to work from an automatically scheduled SSIS job, and it always fails to accept the key from the SFTP site since it runs from the SQLServerAGENT user.
Makalani

winscp.com with key pairs

Hi. I have a server that authenticates ssh sessions using putty key pairs.

Is it possible to script the use of these keypairs using winscp.com and a script file?

I see that winscp.exe offers the option /privatekeyfile:xxxx
But I have not been able to find this option for winscp.com.

Any and all help is much appreciated.

Thanks