Topic "SshPrivateKeyPassphrase and ConvertTo-SecureString"

Author Message
edware

Guest


When using
Code:
SshPrivateKeyPassphrase
with a text based passphrase the powershell script works fine.
If i try to use it with:
Code:
$sessionOptions.SshPrivateKeyPassphrase = ConvertTo-SecureString


I get an error:
Connection has been unexpectedly closed. Server sent command exit status 0.
Advertisements
edware

Guest


Found a workaround:

Code:
$sessionOptions.SecurePassword = ConvertTo-SecureString
$sessionOptions.SshPrivateKeyPassphrase = $sessionOptions.SecurePassword


And this works.
Guest




edware wrote:
Found a workaround:

Code:
$sessionOptions.SecurePassword = ConvertTo-SecureString
$sessionOptions.SshPrivateKeyPassphrase = $sessionOptions.SecurePassword


And this works.


Now when testing on another system it is not working.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The SecureString is supported for password only, not for passphrase.

You have to decrypt the secure string yourself.
See http://stackoverflow.com/q/28352141/850848
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License