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: Connecting with .ppk private key to a SFTP

psawarwadkar wrote:

How can we connect using private key

It's answered above already.
Also, nowadays, WinSCP GUI can generate a script template for you:
https://winscp.net/eng/docs/ui_generateurl#script
psawarwadkar

Re: Connecting with .ppk private key to a SFTP

How can we connect using private key
AlLeX_

I have decided to usе a saved session.
Thank you!
AlLeX_

1. the simple commands winscp.com /command "open user@sftp_srv" /privatekey=c:\private.ppk or winscp.exe /console.... work perfectly.

2. But I want to use a script file

winscp.com /script=script_file.txt and in the script_file.txt I specify the private key

open user@sftp_srv /privatekey=..... This does not work and the error is "Too many parameters with open". Apparently the /privatekey switch here is the problem because without it, the script starts to open the session - of course it fails.
Is there a way to use /privatekey within a script file ?

Thanks
AlLeX_

Thanks, I will try it.
Yes, cli is command line interface!
AlLeX_

Here it is the picture, so the things are clearer :)

How to specify the private key with CLI, this is not the Host key, right ?
AlLeX_

Connecting with .ppk private key to a SFTP

Hi,

I need to connect to a SFTP server with a private .ppk key. I can connect with no problems with WinSCP GUI.
I am trying with CLI, but now luck. Could you, please, tell me the exact syntax of the command I must use.

Thanks