Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate with ssh-rsa by default #1283

Merged
merged 1 commit into from Dec 28, 2023

Conversation

Rob-Hague
Copy link
Collaborator

... to appease servers which disconnect rather than send SSH_MSG_USERAUTH_FAILURE when they do not support sha2 signatures for client authentication (and who may or may not have otherwise sent the server-sig-algs extension which we do not currently implement).

It will still use a sha2 signature if the server does not allow ssh-rsa and sends SSH_MSG_USERAUTH_FAILURE. I would think a server which disables ssh-rsa would be more friendly/compliant than those which disconnect rather than sending SSH_MSG_USERAUTH_FAILURE (i.e. the risk of the opposite now happening, where a server disconnects on receiving ssh-rsa, is low - it is going back to the behaviour as before #1177).

See #1233 (comment) for further discussion

Fixes #1233

@jkillingsworth
Copy link
Contributor

I have created a local build that includes this commit and tested it against three different servers.

  • ✔️ SSH-2.0-Axway.Gateway
  • ✔️ SSH-2.0-OpenSSH_for_Windows_9.4
  • ✔️ SSH-2.0-AWS_SFTP_1.1

All three connect and authenticate successfully when using private key authentication. Only two out of the three were working before. This commit solves the problem I was having as described in #1233 (comment).

Copy link
Collaborator

@WojciechNagorski WojciechNagorski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@WojciechNagorski WojciechNagorski merged commit 2b53e46 into sshnet:develop Dec 28, 2023
1 check passed
@WojciechNagorski WojciechNagorski added this to the 2023.0.1 milestone Dec 28, 2023
@Rob-Hague Rob-Hague deleted the rsa-clientauth branch December 28, 2023 20:43
@Rob-Hague
Copy link
Collaborator Author

Thanks!

@WojciechNagorski
Copy link
Collaborator

The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SshConnectionException after update to 2023.0.0 with private key file
3 participants