[updated 2020-09-20] Generating SSH keys (HOWTO) for your server (+ and your user)

[updated 2020-09-20] Generating SSH keys (HOWTO) for your server (+ and your user)

There are MANY such guides on the internet – this one is probably not any different or better than those.
You should read the man-page for SSH-keygen.
THE best resource/book that I have read on the topic is SSH Mastery – Michael W Lucas. His books are generally some of the best on each topic he writes about.

Meanwhile, the quick & dirty (to delete existing and start fresh) looks like this….

Server keys

Normally you would (probably) do this

to get RSA keys.

IF you’d like non-standard (eg >2048 RSA, or max strength keys, or extra options, etc you need to specify the keys individually). These lines create max options for each key type (assuming your system uses default path of /etc/ssh/*

To display/check your new keys (on the server/host), for each key, in both formats…

Different ssh connectors/apps display them in different formats. Keep a copy of the keys as a lookup for each of your servers/hosts so that you can check them when you connect (yes, you SHOULD check them!).


User keys

Create user keys on LOCAL workstation/client.
If you try to access any system using keys, you do actually have to have some. The lines below will create your keys that you can use to do passwordless logins to authenticated servers.

Leave a Reply

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

nine + 19 =