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: What is the correct syntax to use WinSCP SFTP script

So what authentication are you supposed to use? Password or private key? Or both? Does the connection work in GUI? Please post log from the script (and from the GUI, if the authentication works there).
support@overseas.be

What is the correct syntax to use WinSCP SFTP script

Hi,

We are struggling to find out the correct syntax for a SFTP script.
We started with the generated syntax:
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul /command "open sftp://XXX:pwd@site:7805/ -hostkey=""ssh-rsa 2048 generated_hostkey""" "Your command 1" "Your command 2" "exit"

We receive error:
Server offered these authentication methods: publickey
No supported authentication methods available (server sent: publickey)
Attempt to close connection due to fatal exception:
No supported authentication methods available (server sent: publickey)

We also tried to add extra parameters to the command:
winscp.exe /ini=nul /log="path\logfile" /command "open sftp://XXX:pwd@site:7805/ -hostkey=""ssh-rsa 2048 generated_hostkey"" -privatekey=""path to Private key.ppk"" -clientcert=""pzth to client certificate"" -passphrase=""password of certificate""" "exit"

Thanks for your feedback!