MacOS: Create SSH key
May 24, 2021
Most of the time when I have to clone a repo, I use the https method. Today I configured my environment with SSH keys and it was great.
To create an SSH key you run:
ssh-keygen -m PEM -t rsa -b 4096 -C “your_email@domain”
This outputs a private and public key.
Then you take your public key and paste it on your git repo profile under SSH keys.
Then you add your SSH to your session (aka SSH authentication agent)
ssh-add ~/.ssh/Your_Private_key
Then you’re ready to start cloning via the terminal.