Failed to get reply from Pageant - Server refused public-key signature despite accepting key!
WinSCP 6.1.2 (.NET assembly)
I am able to connect to this via the GUI just fine. So using the .NET NuGet package is where I am having the issue. Furthermore this works on an on-prem server, but not on Azure Web App service. Here is the code I have
Here is a piece of the log:
I have tried the
I am able to connect to this via the GUI just fine. So using the .NET NuGet package is where I am having the issue. Furthermore this works on an on-prem server, but not on Azure Web App service. Here is the code I have
SessionOptions sessionOptions = new SessionOptions(); if (loginPPK != null) { sessionOptions = new SessionOptions { SshPrivateKeyPath = loginPPK, PortNumber = port, HostName = hostName, UserName = userName, Password = password, Protocol = Protocol.Sftp, SshHostKeyFingerprint = sshFingerprint }; } else { sessionOptions = new SessionOptions { PortNumber = port, HostName = hostName, UserName = userName, Password = password, Protocol = Protocol.Sftp, SshHostKeyFingerprint = sshFingerprint }; } if (useOldSCP) { sessionOptions.AddRawSettings("SFTPMaxVersion", "3"); } using (WinSCP.Session session = new WinSCP.Session()) { session.SessionLogPath = logPath; // Connect session.Open(sessionOptions); // Download files TransferOptions transferOptions = new TransferOptions { TransferMode = TransferMode.Binary, FileMask = fileMask }; TransferOperationResult transferResult; transferResult = session.GetFiles(remotePath, localPath, false, transferOptions); // Throw on any error transferResult.Check(); results.Success = transferResult.IsSuccess; }
2023-10-11 13:48:40.242 Reading key file "C:\local\Temp\jobs\triggered\PROGRAM\KEYS\key_name_priv.ppk" . 2023-10-11 13:48:40.262 Pageant is running. Requesting keys. . 2023-10-11 13:48:40.262 Failed to get reply from Pageant ! 2023-10-11 13:48:40.262 Using username "*******". < 2023-10-11 13:48:40.273 Script: Using username "*******". . 2023-10-11 13:48:40.320 Server offered these authentication methods: publickey,password . 2023-10-11 13:48:40.320 Offered public key . 2023-10-11 13:48:40.382 Offer of public key accepted ! 2023-10-11 13:48:40.382 Authenticating with public key "rsa-key-20180709" < 2023-10-11 13:48:40.382 Script: Authenticating with public key "rsa-key-20180709". . 2023-10-11 13:48:40.712 Sent public key signature ! 2023-10-11 13:48:40.835 Server refused public-key signature despite accepting key! < 2023-10-11 13:48:40.835 Script: Server refused public-key signature despite accepting key! . 2023-10-11 13:48:40.851 Server refused public-key signature despite accepting key! . 2023-10-11 13:48:40.898 Server offered these authentication methods: publickey,password . 2023-10-11 13:48:40.898 Prompt (password, "SSH password", <no instructions>, "&Password: ") . 2023-10-11 13:48:40.898 Prompting user for the credentials. . 2023-10-11 13:48:40.914 Prompt cancelled. . 2023-10-11 13:48:40.914 User aborted at password prompt . 2023-10-11 13:48:40.914 Attempt to close connection due to fatal exception:
useOldSCP
on and off.