Hi,
Thanks for this info. According to sshd -T following algorithms are used.
hostkeyalgorithms rsa-sha2-512
pubkeyacceptedalgorithms rsa-sha2-512
Below are logs from not working scenario (Rebex Default settings, and server sshd setting as above)
2025-10-17 09:31:49.426 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_EXT_INFO (247 bytes).
0000 |07-00-00-00-01-00-00-00 0F-73-65-72-76-65-72-2D| .........server-
0010 |73-69-67-2D-61-6C-67-73 00-00-00-DB-73-73-68-2D| sig-algs....ssh-
0020 |65-64-32-35-35-31-39-2C 73-6B-2D-73-73-68-2D-65| ed25519,sk-ssh-e
0030 |64-32-35-35-31-39-40-6F 70-65-6E-73-73-68-2E-63| d25519@openssh.c
0040 |6F-6D-2C-73-73-68-2D-72 73-61-2C-72-73-61-2D-73| om,ssh-rsa,rsa-s
0050 |68-61-32-2D-32-35-36-2C 72-73-61-2D-73-68-61-32| ha2-256,rsa-sha2
0060 |2D-35-31-32-2C-73-73-68 2D-64-73-73-2C-65-63-64| -512,ssh-dss,ecd
0070 |73-61-2D-73-68-61-32-2D 6E-69-73-74-70-32-35-36| sa-sha2-nistp256
0080 |2C-65-63-64-73-61-2D-73 68-61-32-2D-6E-69-73-74| ,ecdsa-sha2-nist
0090 |70-33-38-34-2C-65-63-64 73-61-2D-73-68-61-32-2D| p384,ecdsa-sha2-
00A0 |6E-69-73-74-70-35-32-31 2C-73-6B-2D-65-63-64-73| nistp521,sk-ecds
00B0 |61-2D-73-68-61-32-2D-6E 69-73-74-70-32-35-36-40| a-sha2-nistp256@
00C0 |6F-70-65-6E-73-73-68-2E 63-6F-6D-2C-77-65-62-61| openssh.com,weba
00D0 |75-74-68-6E-2D-73-6B-2D 65-63-64-73-61-2D-73-68| uthn-sk-ecdsa-sh
00E0 |61-32-2D-6E-69-73-74-70 32-35-36-40-6F-70-65-6E| a2-nistp256@open
00F0 |73-73-68-2E-63-6F-6D | ssh.com
2025-10-17 09:31:49.426 DEBUG Sftp(1)[8] SSH: Server supports extension negotiation.
2025-10-17 09:31:49.452 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_SERVICE_REQUEST (17 bytes).
0000 |05-00-00-00-0C-73-73-68 2D-75-73-65-72-61-75-74| .....ssh-useraut
0010 |68 | h
2025-10-17 09:31:49.580 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_SERVICE_ACCEPT (17 bytes).
0000 |06-00-00-00-0C-73-73-68 2D-75-73-65-72-61-75-74| .....ssh-useraut
0010 |68 | h
2025-10-17 09:31:49.580 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_USERAUTH_REQUEST (46 hidden bytes).
2025-10-17 09:31:49.712 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_USERAUTH_FAILURE (53 bytes).
0000 |33-00-00-00-2F-70-75-62 6C-69-63-6B-65-79-2C-67| 3.../publickey,g
0010 |73-73-61-70-69-2D-6B-65 79-65-78-2C-67-73-73-61| ssapi-keyex,gssa
0020 |70-69-2D-77-69-74-68-2D 6D-69-63-2C-70-61-73-73| pi-with-mic,pass
0030 |77-6F-72-64-00 | word.
2025-10-17 09:31:49.713 DEBUG Sftp(1)[1] SSH: Allowed authentication methods for 'verifyUserAutom': publickey, gssapi-keyex, gssapi-with-mic, password.
2025-10-17 09:31:49.714 DEBUG Sftp(1)[1] SSH: Trying public key authentication for 'verifyUserAutom' using 'rsa-sha2-256' (SHA256:D9b+v7vGUBC1G3tDA+WOcJ1vkkciYH1qzMUZSScU8as)
2025-10-17 09:31:49.719 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_USERAUTH_REQUEST (629 hidden bytes).
2025-10-17 09:31:49.853 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_USERAUTH_FAILURE (53 bytes).
0000 |33-00-00-00-2F-70-75-62 6C-69-63-6B-65-79-2C-67| 3.../publickey,g
0010 |73-73-61-70-69-2D-6B-65 79-65-78-2C-67-73-73-61| ssapi-keyex,gssa
0020 |70-69-2D-77-69-74-68-2D 6D-69-63-2C-70-61-73-73| pi-with-mic,pass
0030 |77-6F-72-64-00 | word.
2025-10-17 09:31:49.859 ERROR Sftp(1)[1] SSH: Rebex.Net.SshException: A public key corresponding to the supplied private key was not accepted by the server or the user name is incorrect.
w Rebex.Net.SshSession.ahjfn(String p0, String p1, xaxuc`1 p2, SshGssApiCredentials p3, Boolean p4) w C:\Dev\cpm-extensions-common\Expect\Expect.NET\Internal\Settings\StoreKeyInCache.cs:wiersz 0
2025-10-17 09:31:49.868 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_DISCONNECT (27 bytes).
0000 |01-00-00-00-0B-00-00-00 0E-53-65-73-73-69-6F-6E| .........Session
0010 |20-63-6C-6F-73-65-64-00 00-00-00 | closed....
-------------------------------------------------------------------------------------------------------
Below you can find logs from working execution when the only thing I have changed is adding this line to code:
Rebex.Security.Cryptography.CryptoHelper.SetOption(sftpClient.Settings.SshParameters, "ClientKeyAlgorithms", new string[] { "rsa-sha2-512" });
Server config stayed intact:
2025-10-17 09:28:13.423 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_EXT_INFO (247 bytes).
0000 |07-00-00-00-01-00-00-00 0F-73-65-72-76-65-72-2D| .........server-
0010 |73-69-67-2D-61-6C-67-73 00-00-00-DB-73-73-68-2D| sig-algs....ssh-
0020 |65-64-32-35-35-31-39-2C 73-6B-2D-73-73-68-2D-65| ed25519,sk-ssh-e
0030 |64-32-35-35-31-39-40-6F 70-65-6E-73-73-68-2E-63| d25519@openssh.c
0040 |6F-6D-2C-73-73-68-2D-72 73-61-2C-72-73-61-2D-73| om,ssh-rsa,rsa-s
0050 |68-61-32-2D-32-35-36-2C 72-73-61-2D-73-68-61-32| ha2-256,rsa-sha2
0060 |2D-35-31-32-2C-73-73-68 2D-64-73-73-2C-65-63-64| -512,ssh-dss,ecd
0070 |73-61-2D-73-68-61-32-2D 6E-69-73-74-70-32-35-36| sa-sha2-nistp256
0080 |2C-65-63-64-73-61-2D-73 68-61-32-2D-6E-69-73-74| ,ecdsa-sha2-nist
0090 |70-33-38-34-2C-65-63-64 73-61-2D-73-68-61-32-2D| p384,ecdsa-sha2-
00A0 |6E-69-73-74-70-35-32-31 2C-73-6B-2D-65-63-64-73| nistp521,sk-ecds
00B0 |61-2D-73-68-61-32-2D-6E 69-73-74-70-32-35-36-40| a-sha2-nistp256@
00C0 |6F-70-65-6E-73-73-68-2E 63-6F-6D-2C-77-65-62-61| openssh.com,weba
00D0 |75-74-68-6E-2D-73-6B-2D 65-63-64-73-61-2D-73-68| uthn-sk-ecdsa-sh
00E0 |61-32-2D-6E-69-73-74-70 32-35-36-40-6F-70-65-6E| a2-nistp256@open
00F0 |73-73-68-2E-63-6F-6D | ssh.com
2025-10-17 09:28:13.423 DEBUG Sftp(1)[8] SSH: Server supports extension negotiation.
2025-10-17 09:28:13.453 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_SERVICE_REQUEST (17 bytes).
0000 |05-00-00-00-0C-73-73-68 2D-75-73-65-72-61-75-74| .....ssh-useraut
0010 |68 | h
2025-10-17 09:28:13.579 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_SERVICE_ACCEPT (17 bytes).
0000 |06-00-00-00-0C-73-73-68 2D-75-73-65-72-61-75-74| .....ssh-useraut
0010 |68 | h
2025-10-17 09:28:13.580 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_USERAUTH_REQUEST (46 hidden bytes).
2025-10-17 09:28:13.716 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_USERAUTH_FAILURE (53 bytes).
0000 |33-00-00-00-2F-70-75-62 6C-69-63-6B-65-79-2C-67| 3.../publickey,g
0010 |73-73-61-70-69-2D-6B-65 79-65-78-2C-67-73-73-61| ssapi-keyex,gssa
0020 |70-69-2D-77-69-74-68-2D 6D-69-63-2C-70-61-73-73| pi-with-mic,pass
0030 |77-6F-72-64-00 | word.
2025-10-17 09:28:13.716 DEBUG Sftp(1)[1] SSH: Allowed authentication methods for 'verifyUserAutom': publickey, gssapi-keyex, gssapi-with-mic, password.
2025-10-17 09:28:13.718 DEBUG Sftp(1)[1] SSH: Trying public key authentication for 'verifyUserAutom' using 'rsa-sha2-512' (SHA256:D9b+v7vGUBC1G3tDA+WOcJ1vkkciYH1qzMUZSScU8as)
2025-10-17 09:28:13.728 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_USERAUTH_REQUEST (629 hidden bytes).
2025-10-17 09:28:13.895 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_USERAUTH_SUCCESS (1 bytes).
0000 |34 | 4
2025-10-17 09:28:13.895 DEBUG Sftp(1)[1] SSH: Authentication successful.
2025-10-17 09:28:13.898 DEBUG Sftp(1)[1] SSH: Opening channel 'session' (initial window size: 131072, max packet size: 129024).
2025-10-17 09:28:13.898 VERBOSE Sftp(1)[1] SSH: Sending packet SSH_MSG_CHANNEL_OPEN (24 bytes).
0000 |5A-00-00-00-07-73-65-73 73-69-6F-6E-00-00-00-00| Z....session....
0010 |00-02-00-00-00-01-F8-00 | ........
2025-10-17 09:28:14.116 VERBOSE Sftp(1)[8] SSH: Received packet SSH_MSG_GLOBAL_REQUEST (603 bytes).
Let me know if you need full logs. How Can I pass it to you?
Are you suggesting it is RHEL issue, Putty and Tectia works fine with this user/cert and server config.