Open Terminal and type:
$ ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
Use the defaults by pressing enter.. Generic Example:
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/john.doe/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/john.doe/.ssh/id_rsa.
Your public key has been saved in /Users/john.doe/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
| . o+.+=+++|
| o o++++.|
| .S. ..*o.o|
| o=o.o+.. |
| o.o.+E* |
| ++.++ o |
| .++.. +|
Change to .ssh directory
$ cd ~/.ssh/id_rsa
Open the public key
$ nano ~/.ssh/id_rsa.pub
Copy all the text
Go to Settings (Upper right avatar icon)
Choose SSH and GPG Keys
Click "New SSH Key"
Paste your key into the text area and give it a name.