Thanks!
Post a reply
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
Topic review
- martin
That works too. But it's not recommended syntax.
Only now I have noticed that you have more problems in your original syntax. So my previous post was not enough. The
Only now I have noticed that you have more problems in your original syntax. So my previous post was not enough. The
-privatekey and -passphrase should go to the open command, not put. And the quotes for -privatekey should be double too (or removed as they are not needed).
winscp.com /command "open sftp://username:""@site:22/ -privatekey=""E:\Key\SSH_Key.ppk"" -passphrase=""the passphrase""" "get /outgoing/file.pgp C:\TEMP\file.pgp" "exit"
Thanks, I actually got this working with the following:
winscp.exe SITENAME /passphrase="The passphrase" /command "get /RemoteFile.txt.pgp LocalPath.txt.pgp" "exit"
- martin
Re: Using Passphrase in Command Line
You are missing a dash before the
https://winscp.net/eng/docs/scriptcommand_open#passphrase
passphrase (the syntax is the same as with the -privatekey):
-passphrase=""the passphrase""https://winscp.net/eng/docs/scriptcommand_open#passphrase
Using Passphrase in Command Line
I have a 3rd party vendor I'm trying to connect to via WinSCP, and I'll need to automate the process so I'm trying to figure out how to connect to this vendor using their Private key which requires a passphrase. I'm on version 6.3.7. I have able to connect to their SFTP site with the WinSCP GUI when I key in the passphrase, but I'm not having much luck through command line. Here's what I have now:
winscp.com /command "open sftp://username:""@site:22/" "get /outgoing/file.pgp C:\TEMP\file.pgp" -privatekey="E:\Key\SSH_Key.ppk" passphrase=""the passphrase"" "exit"