How to generate private and public SSH keys

  WEDOS Cloud, WMS

A public SSH key is required to securely and seamlessly log in to some WEDOS services. It serves as authentication with a remote server. In addition, the use of an SSH key brings a number of benefits. For example, you don’t have to worry about your password being eavesdropped.

How to generate SSH keys

SSH keys will be generated mostly on the computer from which you will connect by using private and public keys used. It can also be VPS, Linux distribution, but now also Windows 10, which supports OpenSSH.

The command for generating private and public key is ssh-keygen. The following SSH key types and lengths are supported:
RSA: 1024,2048,3072,4096,5120,6144,7168,8192,9216,10240,11264,12288,13312,14336,15360,16384
DSA: 1024
ECDSA: 256,384,521
ED25519: 256

ssh-keygen -t rsa

Generation begins immediately and you will be asked for the location of the keys (for initial press enter)

Generating public/private rsa key pair.
Enter file in which to save the key (/home/petr/.ssh/id_rsa):

Then You will be asked to enter a passphrase to encrypt the private key. (without the passphrase password press enter)

Enter passphrase (empty for no passphrase)

Repeat the action

Enter same passphrase again

Keys are generated

Your identification has been saved in /Users/petrriha/.ssh/id_rsa.
Your public key has been saved in /Users/petrriha/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:mF0eXhS21/tLsOKEWMl34MGN490lBZ3CAs6Jk2DKzfY petrriha@Petr

Creating an SSH key pair on different operating systems

Use the same procedure described in the previous paragraph for all Linux distributions, including macOS and Windows 10. The only thing that changes is the default path where the SSH key pair is stored

Linux

/home/vase_uzivatelske_jmeno/.ssh/ 

macOS

/Users/myname/.ssh/id_rsa.pub 

Windows 10

C:\Users\vase_uzivatelske_jmeno/.ssh/