linux

OpenSSH – Checking the server fingerprint

1 min read

If we want to check the fingerprint of the SSH server we intend to connect to remotely with this protocol, we can do it with the following steps.

If we have physical access to the server and to its terminal, we can check which keys it has in its configuration folder:

text
/etc/ssh

We can list the keys with the command:

text
ls /etc/ssh/*key.*

We should get a list of the various private and public keys used by the SSH server service.

Then, with the ssh-keygen command, we can check the fingerprint of each one using the command’s options. The options to use are:

text
ssh-keygen -l -v -f <key file>

-l : we want the key’s fingerprint.

-v : we get the ASCII art of the key’s fingerprint

-f : the key file whose fingerprint we want

Photo by [Kevin Horvat](https://unsplash.com/@hidd3n?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/monitor-de-tela-plana-ativado-Pyjp2zmxuLk?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)

#ssh#ubuntu