To generate a new key pairs
ssh-keygen -t rsa
#################
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): linuxwin_rsa_key
Enter passphrase (empty for no passphrase):*******
Enter same passphrase again:*******
Your identification has been saved in linuxwin_rsa_key
Your public key has been saved in linuxwin_rsa_key.pub
The key fingerprint is:
SHA256:/nnU**********************hu2c user@servername
The key's randomart image is:
+---[RSA 3072]----+
| 8===o |
| 0++++___ |
| =.o |
| ...+|
| ++++++o+o|
| . *****|
| . ***** |
| ***** |
| |
+----[SHA256]-----+
Install public key on the server
ssh-copy-id -i linuxwin_rsa_key.pub user@server
or just copy it to ~/.ssh/authorized_keys
cp linuxwin_rsa_key ~/.ssh/authorized_keys
Use Privete key with ssh client, mobaXterm, PuTTy…etc