SSH login with ED25519 keys

To generate new key pairs

ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -C "root@linuxwin" -N ""

Empty files if needed

echo "" > /root/.ssh/authorized_keys
echo "" > /root/.ssh/known_hosts

Add public key to Authorized_keys

cat /root/.ssh/id_ed25519.pub >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

Set permissions

chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
chmod 644 /root/.ssh/known_hosts
chown -R root:root /root/.ssh

Copy private key to ssh client

cat /root/.ssh/id_ed25519

### copy everything from
-----BEGIN OPENSSH PRIVATE KEY-----
    ...... until .....
 -----END OPENSSH PRIVATE KEY-----

SSH login with RSA keys

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]-----+
ssh-copy-id -i linuxwin_rsa_key.pub user@server
cp linuxwin_rsa_key.pub ~/.ssh/authorized_keys
seo reseller