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

heiko80

@martin
Many Many THANKS!!! It works now!
Searched hours trough the FAQ and Forum, but did not notice this hint.

I'm not allowed to change Keys. It is a customer managed enviroment with limited access for me.
martin

Re: Problem with Passphrase option in Script

You have to double the double quotes:
-passphrase="My,P%=!#""a$=k""-5,2""23'""phase"

See https://winscp.net/eng/docs/scripting#quotes

Though in general, I do not see what is complicated about re-saving your private key with more sensible passphrase. Just load your key to PuTTYgen, change the passphrase and save it back.
heiko80

Hi,
I read about Pageant already, but as this is a customer environment, it is not so easy to install a new software.
So I would prefer a solution without additional software if possible. Maybe there is any way I could pass my Passphrase trough the -passphrase option.
heiko80

In fact, that was my initial assumption...

I can't change the password on my own, it is really complex to do so. If it was this easy, I would do that already.

Tried also Encoding like in Password field, but it seems this is not possible in Passphrase field.
user564758

-passphrase="My,P%=!#"a$=k"-5,2"23'"phase"

Most likely that you chose you use double quotes inside a double quoted string.

100% of the times it's better to not have password that contains certain characters, like single or double quotes or ending in an escape character.

Use a password with no quotes or escape them. See how that goes.
heiko80

Problem with Passphrase option in Script

Hi,
I have created a script using Private Key Files. Also using the -passphrase option. But my Passphrase isn't working. I suggest it is a problem with special characters.

Passphrase: My,P%=!#"a$=k"-5,2"23'"phase
This is an example with same special characters as the original.

Is there any way I could automate my script without changing the Passphrase (not possible for me).

Script:
option batch on
 
option confirm off
 
open sftp://username@1.2.3.4:1234/ -hostkey="ssh-rsa 2048 xyzwvIj/Gsk48njdh6geGF6uXwqAtnfgMV7qUPy202w" -privatekey="D:\Pfad\priv.ppk" -passphrase="My,P%=!#"a$=k"-5,2"23'"phase"
lcd D:\Pfad\Import
cd home
cd data
get file.txt
close
exit

If I use the Script without -passphrase option and enter the Passphrase manually when asked for, it works.