Failed to get reply from Pageant - Server refused public-key signature despite accepting key!

Advertisement

Corey10e
Joined:
Posts:
4
Location:
USA

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
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;
}
Here is a piece of the log:
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:
I have tried the useOldSCP on and off.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,291
Location:
Prague, Czechia

Re: Failed to get reply from Pageant - Server refused public-key signature despite accepting key!

Please attach full logs both from "on-prem server" and "Azure Web App service".

Reply with quote

Corey10e
Joined:
Posts:
4
Location:
USA

Thanks Martin, files attached privately.
  • sftp-onprem.log (10.38 KB, Private file)
Description: OnPrem Logs
  • sftp_azure.txt (439.39 KB, Private file)
Description: Azure Logs

Reply with quote

martin
Site Admin
martin avatar

  1. You are using different versions of WinSCP on Azure and on "OnPrem". Plase post consistent logs from the same versions of WinSCP.
  2. The Azure log contains 16 sessions, some of which succeeded to connect and some did not. So is it problem intermittent?

Reply with quote

Corey10e
Joined:
Posts:
4
Location:
USA

Old version works fine, we prefer to constantly have the most recent version of course. Attached is the log from the old. We connect to both USBank and Wells Fargo... USBank works fine with the new version but not Wells Fargo... thats whats in the original file. Please let me know if I can provide anything else.
  • sftpazure2.txt (26.96 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar

So do I understand right that the actual problem is not on-prem vs. Azure, but 5.21.7 vs. 6.1.2?
Can you connect with WinSCP 6.1.2 GUI? Can you connect with PuTTY 0.79?

Reply with quote

Corey10e

WinSCP 6.1.2 GUI is fine
PuTTY is not, but that being said I have never used PuTTY to connect to anything because I always use WinSCP. With PuTTY I get "Server refused to allocate pty".

Reply with quote

Advertisement

You can post new topics in this forum