$fingerprint

Advertisement

Burschi
Joined:
Posts:
3
Location:
France

$fingerprint

Hello
Pls, how I have to us "$fingerprint"
I hav to download (function?) and uploade (function?) file
My scripte is not work correctly
Thx for your help
Arnold
cls
Get-Module winscp | ft Path
 
$hostname = 'ftp://.........'
$username = '.............'
$password = '.............'
$fingerprint = 'yourFingerprint'
$PortNumber = "22"
 
$WinSCPSessionOption = New-WinSCPSessionOption -Property @{
    Protocol              = [WinSCP.Protocol]::Sftp # Transfer Protocols (SFTP, FTP, SCP, WebDAV, S3)
    HostName              = $using:hostname
    UserName              = $using:username
    SecurePassword        = $using:password
    PortNumber            = $using:PortNumber
  }
 
$sshHostKeyFingerprint = Get-WinSCPHostKeyFingerprint -SessionOption $WinSCPSessionOption -Algorithm SHA-256
$WinSCPSessionOption.SshHostKeyFingerprint = $sshHostKeyFingerprint
$WinSCPSession = New-WinSCPSession -SessionOption ($WinSCPSessionOption)
 
Get-WinSCPSession
 
Receive-WinSCPItem -WinSCPSession $WinSCPSession -RemotePath "/" -LocalPath "C:\Users\admin\OneDrive\......."
$WinSCPSessionOption.SshHostKeyFingerprint = $sshHostKeyFingerprint
 
Remove-WinSCPSession

Reply with quote

Advertisement

Burschi
Joined:
Posts:
3
Location:
France

Hello thx to tcheko! (merci)

So I don't need "fingerprinton" on the start scripte?:
$hostname = 'ftp://.........'
$username = '.............'
$password = '.............'
$fingerprint = '$yourFingerprint' # eqal is obsolete her ????
$PortNumber = "22"
Many thx to you
Arnold

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,253
Location:
Prague, Czechia

I have no idea what should "eqal is obsolete her" mean.

You should set SessionOption.SshHostKeyFingerprint, if you care about security.
The article I've linked in my previous post explains, where you should get the value from.

If you do not care about security, use SshHostKeyPolicy.GiveUpSecurityAndAcceptAny.

Reply with quote

Advertisement

You can post new topics in this forum