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-----