Use a key like “ed25519”
ssh-keygen -t ed25519
print the public key:
cat ~/.ssh/id_ed25519.pub
add your key(s) to authorized keys:
edit:
sudo nano ~/.ssh/authorized_keys
or copy directly:
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh # the .ssh directory itself
chmod 600 ~/.ssh/* # by default all the files in .ssh
chmod 644 ~/.ssh/*.pub # change public key permissions
ssh-add -l
ssh-add -D
ssh-keygen -p -f <path-to-key>
from here:
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem