GitHub SSH key setup (macOS) - renekuda38/git GitHub Wiki
This guide is mainly for my personal usage. But feel free to use it.
Check the official guides.
ls -al ~/.ssh
-
ssh-keygen -t ed25519 -C "[email protected]"
-
if you are using a legacy system that doesn't support the Ed25519 algorithm, use:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
3.1 Start ssh-agent in the background
eval "$(ssh-agent -s)"
3.2. Modify ~/.ssh/config
file
touch ~/.ssh/config # if it's not created already
# put below text into that file:
Host github.com
AddKeysToAgent yes
UseKeychain yes # if you used passphrase for your key
IdentityFile ~/.ssh/id_ed25519 # name based on your file
3.3 Add your SSH private key to the ssh-agent and store your passphrase in the keychain
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
-
--apple-use-keychain
=-K
$ pbcopy < ~/.ssh/id_ed25519.pub
# Copies the contents of the id_ed25519.pub file to your clipboard
- then paste the key to GitHub SSH settings
git remote add origin [email protected]:renekuda38/<repo>.git