I am having trouble verifying Public Gateway SSH key fingerprints from Cockpit
Problem
You may check your Public Gateway's SSH bastion logs in Scaleway Cockpit and notice that the SSH key fingerprints logged there do not match the SSH key fingerprints shown in your Project dashboard in the Scaleway console.
Cause
SSH key fingerprints are in SHA256
format in Cockpit logs, but in MD5
format in the console's Project dashboard.
SHA256
computes a 256-bit hash value from the SSH key, represented as a 64 character hexadecimal number, often then Base-64 encoded.- Example:
SHA256:ZLqisKhPVs2R2jrpYlukWWMkbAdhD4zkUckc7L4/W5w
- Example:
MD5
computes a 128-bit hash value from the SSH key, represented as a 32-character hexadecimal number.- Example:
MD5:d2:40:3d:de:67:9c:d3:fd:1e:20:a3:c2:c3:d2:25:69
- Example:
Solution
You need access to the original public key in order to successfully cross-check the two sources. Depending on your situation, choose one of the solutions listed below.
Generate both fingerprint formats from a local public SSH key
If you have the public SSH key stored on your local machine, you can use the ssh-keygen
utility to generate both a SHA256
and a MD5
fingerprint of the key. You can then compare these fingerprints with those shown in Cockpit and the Scaleway console.
Generate both fingerprint formats from a remote public SSH key
If the public SSH key is stored on an accessible remote host, use the ssh-keyscan
utility to get the key from the remote host. You can then examine the raw public key data and generate fingerprints in different formats as shown in the previous section, and compare these fingerprints with those shown in Cockpit and the Scaleway console.
Compare fingerprint to trusted fingerprint
A trusted fingerprint is one that you or your organization has verified to be legitimate. You may have a trusted fingerprint e.g. in a known_hosts
file or a secure key management system. It may be in SHA25
or MD5
format. You can compare this trusted fingerprint to the fingerprint shown in either the Cockpit fingerprint or the console fingerprint, depending on the format.
Converting one fingerprint format to another
It is not possible to convert a SHA256
format fingerprint to an MD5
format fingerprint, or vice versa, without the original public key. This is because these fingerprints are created with one-way hash functions. You must have the original public key in order to generate the desired fingerprint type from it, and compare with fingerprints shown in Cockpit or the Scaleway console.