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

FEATURE REQUEST: Display fingerprint on key creation #52

Open
VA1DER opened this issue Apr 7, 2021 · 3 comments
Open

FEATURE REQUEST: Display fingerprint on key creation #52

VA1DER opened this issue Apr 7, 2021 · 3 comments

Comments

@VA1DER
Copy link

VA1DER commented Apr 7, 2021

It would be nice if a key fingerprint was displayed at host key creation. Ass it stands now, there is no way to perform the initial fingerprint verification when you connect.

@janmojzis
Copy link
Owner

Hello,
tinysshd-printkey prints the fingerprint.
Example:

# tinysshd-makekey keydir
# tinysshd-printkey keydir
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHfU40DKe3EgstiZfl+Tss8ijkh2rj/yxSTdZCE+/GXK

@VA1DER
Copy link
Author

VA1DER commented Apr 7, 2021

No, tinysshd-printkey does not print the fingerprint. It prints the base64 representation of the public key. To get the fingerprint you have to redirect the output to a file, copy that file over to a machine that has OpenSSH, and then use ssh-keygen to display the fingerprint.

# tinysshd-printkey > textkeyfile

Then move textkeyfile to a machine that has openssh, and then

# ssh-keygen -lf textkeyfile

Key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAfBnHfUz3xS8cAFho3Rcfo3gEia08Ge+7JIDVjN+bk
Fingerprint: 256 SHA256:skPLlpa08M2z4cs/7RUEnb3vcaTmCqjOj03kBjozh/M

@janmojzis
Copy link
Owner

Of course tinysshd-printkey prints the public-key (sorry for the typo "s/fingerprint/public-key/").

But I think You don't need to convert the output to the sha256 fingerprint and check the fingerprint.
You can use the output directly. E.g. directly to the .ssh/known_host file.

echo "`hostname`:22 `tinysshd-printkey /etc/tinyssh/sshkeydir`" >>  .ssh/known_host

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

No branches or pull requests

2 participants