Topic "Property 'GiveUpSecurityAndAcceptAnySshHostKey'"

Author Message
bab5470
[View user's profile]

Joined: 2014-01-02
Posts: 1
I have the following powershell code using the winscp .net assembly:

# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom("C:/tools/WinSCPnet.dll") | Out-Null

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "myserver.domain.local"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "supersecret"
#$sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:e8:da:54:12:6c:20:fa:78:24:b4:8d:69"
$sessionOption.GiveUpSecurityAndAcceptAnySshHostKey = $True

Note that I've commented out the SshHostKeyFingerprint and I am using GiveUpSecurityAndAcceptAnySshHostKey = $True.

When am getting the following error:
Property 'GiveUpSecurityAndAcceptAnySshHostKey' cannot be found on this object; make sure it exists and is settable

I believe this feature was introduced in 5.2 and I'm running version 5.5 of the WinSCPnet.dll so I am not sure why I would be getting this error. Can anyone help?

Thanks
Brad
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
You are missing s. It should be: $sessionOptions.GiveUpSecurityAndAcceptAnySshHostKey.
samv
[View user's profile]

Joined: 2014-01-14
Posts: 7
Location: Canada
worked for me
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
samv wrote:
worked for me

Is there any particular please you copied the typo from? Or is it just a coincidence that you both made the same mistake?
_________________
Martin Prikryl
samv
[View user's profile]

Joined: 2014-01-14
Posts: 7
Location: Canada
prikryl wrote:
samv wrote:
worked for me

Is there any particular please you copied the typo from? Or is it just a coincidence that you both made the same mistake?



Nope, Just reaffirming that GiveUpSecurityAndAcceptAnySshHostKey works as designed.
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