Asking about password but I have only key

Advertisement

Anatoliy
Joined:
Posts:
2

Asking about password but I have only key

Hi all, I'm very new in WinSCP don't beat me for stupid question, I was trying to google it.

I have blown my mind already, pls any help would be great for me, thanks in advance.

I use this code to upload test.txt into SFTP:/Outbound/Manual/. Pls see below:
option batch abort
option confirm off
open sftp://FTP-Test;fingerprint=ssh-rsa-F0Lmx8-GeDs@51.141.48.23454/
PutFile d:\TEST\test.txt /Outbound/Manual/
exit
But it's asking about password I don't have it at all.

BTW I'm not sure that this line I right? PutFile d:\TEST\test.txt /Outbound/Manual/

Screenshot 2022-01-06 at 16.24.51.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
37,599
Location:
Prague, Czechia

Re: Asking about password but I have only key

If you want to use a public key authentication, you need to specify your private key using -privatekey switch of the open command:
https://winscp.net/eng/docs/scriptcommand_open#privatekey

It's put, not PutFile.
See https://winscp.net/eng/docs/scriptcommand_put

WinSCP GUI can generate full script template for you:
https://winscp.net/eng/docs/ui_generateurl#script

Reply with quote

Advertisement

You can post new topics in this forum