SSH
SSH Keys
Using OpenSSH
Create a key:
ssh-keygen -t ed25519 -C "Your comment here" -f ~/.ssh/$hostname.key
Or, in RSA format:
ssh-keygen -t rsa -b 4096 -C "Your comment here" -f ~/.ssh/$hostname2.key
Make sure it has safe permissions:
chown 600 $hostname*.key
Then for the user you want to log in as, copy the .pub file's contents to the user's .ssh/authorized_keys file. It also needs to have 600 permissions.
Using Puttygen
Linux
Install the putty-tools package if you haven't already.
Create the key:
puttygen -t ed25519 -C "Your comment here" -o ~/.ssh/$hostname.ppk
Or, in the RSA format:
puttygen -t rsa -b 4096 -C "Your comment here" -o ~/.ssh/$hostname2.ppk
Either way, the file should have 600 permissions. Print the public key:
puttygen -L ~/.ssh/$hostname.ppk
Then for the user you want to log in as, copy the output to the user's .ssh/authorized_keys file. It also needs to have 600 permissions.