WinSCP command line not accepting working options from UI

Advertisement

sparkxy
Guest

WinSCP command line not accepting working options from UI

I am trying to script out connecting to some Unix hosts via SCP. I have working public key (.ppk format) and auth certificate. If I put this info in the GUI it works perfectly.

Using the same information on the command line tells me it is refused. I have been searching for hours but have not found any useful answers. Can someone help me?

I am trying:
winscp scp://ops@172.20.1.26 /clientcert=C:\Users\automation\.ssh\generated_ed25519.ppk /privatekey=C:\Users\automation\.ssh\server_ed25519_cassh.pub
and I get back:
Searching for host...
Connecting to host...
Authenticating...
Using username "ops".
Server refused our key.
No supported authentication methods available (server sent: publickey)
Authentication log (see session log for details):
Using username "ops".
Server refused our key.

Authentication failed.
winscp>
If this is a simple answer, then I am sorry i didn't find whatever this answer is, google doesn't like me.

Reply with quote

Advertisement

Guest

If using scripts not GUI so then something like
winscp.com /command "open scp://ops@172.20.1.26/ -privatekey=C:\Users\automation\.ssh\generated_ed25519.ppk" "put localfile.txt /remote/path/" "exit"

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: WinSCP command line not accepting working options from UI

The private key (ppk) goes to the /privatekey command-line parameter.
https://winscp.net/eng/docs/commandline#privatekey

There's no parameter for the detached certificate. So you either have to use raw session setting DetachedCertificate.
Or use PuTTYgen to add the certificate directly into the ppk file.
https://winscp.net/eng/docs/ui_puttygen#certificate

Reply with quote

Advertisement

You can post new topics in this forum