Useful Server Commands

There are some useful commands that I will need from time to time, but due to the bad memory that I have, I cannot remember all of them, so I want to keep them down here.

Show the ssh fingerprint on server side

Sometimes I need to SSH into a remote server, but every first time I try to connect to a server, no matter via password authentication or private key authentication, I am always given a fingerprint of the public key in the server and asked whether I want to accept it. If I type “yes” and continue, this public key will be added to .ssh/known_hosts in my home directory. I just want to verify that it is the correct fingerprint from my remote server whenever it is possible, the commands are as below.

To show the MD5 version of the fingerprint of the key:

To show the SHA1-256 version:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.