Post a reply

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)


Topic review



the solution to this issue has been found. For you information, if you use the SFTP scrip posted on the WINSCP site you will need to add the lines below in bold.

For some reason when the path to the Key and the passphrase was added it started to work. The parts in bold were added to resolve. (Parts in red are variables specific to your solution)

$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = ""
UserName = "USERNAME"
PrivateKeyPassphrase = "XXXXXXXXXXX"
SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
SshPrivateKeyPath = "C:\Keys\PRIVATEKEY.ppk"

I have attached the logs to the script, the GUI connects fine.

Re: SFTP Sync Script Error

Can you connect in WinSCP GUI?
If you can, post complete log file both from the GUI and your script.

SFTP Sync Script Error

I am using a PowerShell script posted on his site to transfer files from an SFTP site to a local server. Up until recently, it was working but stopped 2 weeks ago and looking at the log I am getting this error message when it runs.

[08/19/2019 12:20:31] Sync Started
[08/19/2019 12:20:31] Error: Exception calling "Open" with "1" argument(s): "Disconnected: No supported authentication methods available (server sent: publickey)
Authentication log (see session log for details):

I created a public/private key using putty and I obtained the fingerprint from the win SCP app but I am struggling to get past this. I know the keys have not changed. Does anyone have any ideas?