The recommendation now is to use ED25519 whenever you can.
Commands
Using ED25519
ssh-keygen -t ed25519 -C "[email protected]"
Using RSA
ssh-keygen -t rsa -b 4096 -C "[email protected]"
-C is optional, if not used then the login and machine name is going to be used instead.
Use -b to specify key size.
Ways to create SSH keys on macOS
On Mac OSX and Linux
You just get to Terminal and start typing:
ssh-keygen -t ed25519 -C "[email protected]"
You can use either your email address as label or anything that can be used to remind you what you use the SSH key for.
On PC
You need to download an external client such as puttygen (from putty) or if you have GIT, you can use the bash shell interface as well and the command is the same.
ssh-keygen -t ed25519 -C "[email protected]"
Adding the Key
eval $(ssh-agent -s) ssh-add ~/.ssh/id_keys
To see the Keys
ssh-add -l
To copy key to clipboard:
$ pbcopy < ~/.ssh/id_keys.pub
Further Reading
PuTTY: a free SSH and Telnet client
Git
SSH key-type, rsa, dsa, ecdsa, are there easy answers for which to choose when?
Use SSH keys to communicate with GitLab
Leave a Reply