Run:
ls -al ~/.ssh
Look for id_ed25519
or similar files.
Run:
ssh-keygen -t ed25519 -C "[email protected]"
Press Enter to accept the default location (~/.ssh/id_ed25519
) and optionally set a passphrase.
Start the SSH agent:
eval "$(ssh-agent -s)"
Then add your private key:
ssh-add ~/.ssh/id_ed25519
Run:
cat ~/.ssh/id_ed25519.pub
Or use:
pbcopy < ~/.ssh/id_ed25519.pub
xclip -sel clip < ~/.ssh/id_ed25519.pub
Run:
ssh -T [email protected]
You should see a success message.
Set Git to use SSH:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Clone a repo using SSH:
git clone [email protected]:username/repository.git
In ~/.ssh/config
(if needed):
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
Return to Home