I sometimes need to get the SSH fingerprints of the machines I host before connecting to them from a different machine, but I often can't remember how to find those fingerprints, so I should write them down instead of searching for the information again.
I'm working off of this StackOverflow post.
To get the fingerprints, run the following command:
ssh-keyscan localhost | ssh-keygen -lf -
localhost
can be changed to any
other IP address or URL, but in this case we want to
get the fingerprints of the local machine. The
output will look something like this:
3072 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX localhost (RSA)
256 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX localhost (ECDSA)
256 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX localhost (ED25519)