Skip to content

Conversation

jborean93
Copy link
Contributor

Add support for gssapi-with-mic user authentication. This can be used to connect to an SSH server that support GSSAPI/Kerberos authentication using GSSAPI on nix and SSPI on Windows.

Fixes: #184

Let me know what you think about my approach in the tests. Kerberos is very picky when it comes to hostnames but hacking in localhost seems to been enough for it to run locally. I'm also unsure how to deal with authentication errors so any suggestion as to when it should raise an exception or just ignore and try and next one would be nice to hear.

Add support for gssapi-with-mic user authentication. This can be used to
connect to an SSH server that support GSSAPI/Kerberos authentication
using GSSAPI on nix and SSPI on Windows.
@jborean93 jborean93 force-pushed the gssapi-with-mic branch 4 times, most recently from 1922bf8 to 534b916 Compare June 13, 2024 05:25
@tmds
Copy link
Owner

tmds commented Jun 13, 2024

@jborean93 thanks for picking this up! The PR is already looking quite comprehensive!

I read through the PR and added some feedback.
I'll try to do an in-depth review in the coming week

@tmds tmds merged commit 8b07f29 into tmds:main Jun 18, 2024
@tmds
Copy link
Owner

tmds commented Jun 18, 2024

@jborean93 thanks a lot for contributing this very useful feature!

@jborean93 jborean93 deleted the gssapi-with-mic branch June 18, 2024 10:08
@jborean93
Copy link
Contributor Author

Thank you for writing such a great library and a very speedy review, it is very much appreciated!

@tmds
Copy link
Owner

tmds commented Jun 26, 2024

This is part of 0.4.0 which was just uploaded to nuget.org.

// While only Sign is needed we need to set EncryptAndSign for
// Windows client support. Sign only will pass in SECQOP_WRAP_NO_ENCRYPT
// to MakeSignature which fails.
// https://github.com/dotnet/runtime/issues/103461
Copy link
Owner

Choose a reason for hiding this comment

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

hi @jborean93, the issue you referenced here is closed. Is there some change we can/should make for .NET9+?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the fix we can change it to RequiredProtectionLevel = ProtectionLevel.Sign;. but I don't think it ended up being backported to net9 so the fix is only present in net10. The PR which fixed it dotnet/runtime#105605 was merged after net9 was created and I don't see any reference to a backport.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for the input! I assumed it was fixed in .NET 9 based on the issue milestone.
We can add the change under an #if NET10_0_OR_GREATER.

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.

gssapi-with-mic Credential Support RFC 4462
2 participants