- Generate new ssh key for your github email:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
// Intro to accept default directory, set an optional passphrase
eval "$(ssh-agent -s)"- Paste the following in
vim ~/.ssh/config:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa- Store the key and copy to clipboard:
ssh-add -K ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub- Go to Github / Settings / "Ssh and gpg keys" / "New ssh key":
- Pick a name and paste the key that should be in the clipboard
Reference: Generate ssh key and Adding the new ssh key to github