Generate an SSH Key Pair from Mac
Generate an SSH Key Pair
Open a new Terminal window
Type
ssh-keygen -b 4096 -t rsa
You will be prompted to enter a filename. By default, your keys will be saved as id_rsa and id_rsa.pub. Simply press Enter to confirm the default - there is no need to change this unless you have multiple keys! (Note: if you would like to change the default filename, you'll need to include the complete file path)
When prompted, enter a passphrase.
This will created a hidden directory called .ssh that contains both your public (id_rsa.pub) and private (id_rsa.) key files.
View your public key
In the same Terminal window, type
cat .ssh/id_rsa.pub
. This will print your public key. (Note: if you are not using the default key filename, please substitute your public key name in place of id_rsa.pub).Copy this complete key, starting with ssh and ending with a username such as user@Admins-MacBook-Pro.local