unable to connect - open command has too many arguments

Advertisement

Brent
Joined:
Posts:
2
Location:
SoCal

unable to connect - open command has too many arguments

Hello, I'm trying to setup a connection for POC that I'll then modify so that it connects to an external vendor and retrieves a file for us. I looked through some recent posts and saw similar questions but it didn't look like they applied exactly. I've been using the open command page and the session url, and useful scripts pages for assistance on the command and syntax. Here's the error I'm getting...

I have connected to this host with the gui so I know connectivity works from host a to host b, and that it's not the first time they've shared files...

File (currently):
option batch abort
option confirm off
open sftp://user:password@host.company.com -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
get "test.txt" "C:\Program Files\Winscp\test.txt"
exit


Error (before -hostkey argument):
C:\Program Files\Winscp>winSCP.com /script=test.txt
batch abort
confirm off
Searching for host...
Connecting to host...
Authenticating...
The server's host key was not found in the cache. You have no guarantee that the
server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
If you trust this host, press Yes. To connect without adding host key to the cac
he, press No. To abandon the connection press Cancel.
Continue connecting and add host key to the cache?
(Y)es, (N)o, (C)ancel: Cancel
Host key wasn't verified!
Authentication failed.

C:\Program Files\Winscp>


Error after using the -hostkey

C:\Program Files\Winscp>winSCP.com /script=test.txt
batch abort
confirm off
Too many parameters for command 'open'.

C:\Program Files\Winscp>


Thanks!
-Brent

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,476
Location:
Prague, Czechia

Re: unable to connect - open command has too many arguments

See https://winscp.net/eng/docs/faq_script_switch

If that does not help, please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Brent
Joined:
Posts:
2
Location:
SoCal

Thank you, I upgraded and then was getting an error about use open command instead of deprecated command line parameter, that was interesting because I was trying to use the open command but I found another thread in the forum where you linked another support page, and that resolved the connection and file transfer problems.

cheers!
Brent

Reply with quote

Advertisement

You can post new topics in this forum