Skip to content
New issue

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

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

Already on GitHub? # to your account

Expose host's public key #762

Closed
roblourens opened this issue Feb 13, 2019 · 4 comments
Closed

Expose host's public key #762

roblourens opened this issue Feb 13, 2019 · 4 comments

Comments

@roblourens
Copy link

Is there any way to get the host's actual public key, not just the hashed fingerprint, when connecting? I ask because I want to write it to the user's known_hosts file if they accept the fingerprint, same as what openssh does.

I see the hostVerifier option, my understanding is that it gives a hashed fingerprint of the host's key but known_hosts contains the actual public key.

@mscdex
Copy link
Owner

mscdex commented Feb 13, 2019

Not currently

@roblourens
Copy link
Author

Would you accept a PR for it?

I'm not sure of the best way to expose it. Maybe adding a new callback option besides hostVerifier. Adding a new argument to hostVerifier in front of its callback would be a breaking change. I would want both the hash and the key at once.

@shangchengxiang
Copy link

May I ask a question?
I get the figers from cmd and hostVerifier . But they are different.
figer from cmd:
ssh-keygen -q -l -f .ssh/known_hosts -F hostname
hostname ECDSA SHA256:YuukV3vH+XwiDNtp62MvZsDr0XeIOmzNKOyPW/kLkQk
figer from hostVerifier :
693994cdf1f576fea93ea184d668fa1bdb20d650dc78a44206bd4a0cf8fa7298
So if change the format to compare them?

@mscdex
Copy link
Owner

mscdex commented Oct 7, 2020

This should be resolved now with the ssh2 rewrite. For more details see here.

@mscdex mscdex closed this as completed Oct 7, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants