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

set SSH_KEY_ID if present #495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxfortun
Copy link

When authenticating via TrustedUserCAKeys it is useful to know the key_id in order to be able to correlate the used key to the original identity for which the key was signed. This can be leveraged to federate authentication. The process is described here.

@djmdjm
Copy link
Contributor

djmdjm commented May 9, 2024

I think you should be able to do this using ExposeAuthInfo without code changes. This is a more general mechanism, but it would require you to parse keys

@maxfortun
Copy link
Author

I will check this out. Thanks.

@maxfortun
Copy link
Author

@djmdjm , you are absolutely right. I was able to extract the key id. That totally solves my problem.
Thank you again.

cat $SSH_USER_AUTH | cut -d' ' -f2- | ssh-keygen -L -f - | grep '^ *Key ID:'|cut -d'"' -f2

@maxfortun
Copy link
Author

There is only one edge-case to this. If the file system is out of space, the file won't be written and a user won't be able to login. Hypothetically, with an ENV only solution, the auth may still work.

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