SSH Setup Guide for GitHub
This guide will help you set up SSH authentication for GitHub so you can push/pull without entering credentials.
Step 1: Generate SSH Key
Open Terminal and run:
ssh-keygen -t ed25519 -C "packslighter@users.noreply.github.com"What happens:
- You’ll be prompted:
Enter file in which to save the key (~/.ssh/id_ed25519): - Press Enter to use the default location
- You’ll be prompted:
Enter passphrase (empty for no passphrase): - Press Enter for no passphrase (or enter one if you want extra security)
Expected output:
Your public key has been saved in ~/.ssh/id_ed25519.pub
The key fingerprint is: ...
Step 2: Add SSH Key to SSH Agent
Start the SSH agent and add your key:
# Start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Add your SSH key to the ssh-agent
ssh-add ~/.ssh/id_ed25519Step 3: Copy Your Public Key
Display your public key to copy it:
cat ~/.ssh/id_ed25519.pubSelect and copy the entire output (should look like):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... packslighter@users.noreply.github.com
Step 4: Add Key to GitHub
- Go to GitHub Settings: https://github.com/settings/keys
- Click “New SSH key” (green button)
- Fill in:
- Title:
MacBook Pro(or whatever describes this computer) - Key type:
Authentication Key(default) - Key: Paste your public key (from Step 3)
- Title:
- Click “Add SSH key”
- Confirm with your GitHub password if prompted
Step 5: Test SSH Connection
Test that SSH authentication works:
ssh -T git@github.comExpected output:
Hi packslighter! You've successfully authenticated, but GitHub does not provide shell access.
If you see a permission denied error, wait a minute and try again (GitHub needs a moment to register the key).
Step 6: Change Git Remote to SSH
Update your repository to use SSH instead of HTTPS:
cd ~/path/to/brainforge-vault
git remote set-url origin git@github.com:brainforge-ai/brainforge-vault.gitVerify the change:
git remote -vYou should see:
origin git@github.com:brainforge-ai/brainforge-vault.git (fetch)
origin git@github.com:brainforge-ai/brainforge-vault.git (push)
Step 7: Test Git Push
Now try pushing:
git push origin gtm/linkedin-playbooksIt should work without asking for credentials! 🎉
Troubleshooting
”Permission denied (publickey)” error
- Make sure you added the key to GitHub (Step 4)
- Verify key was added:
ssh-add -l(should show your key) - Try testing again:
ssh -T git@github.com
”Host key verification failed”
- Remove old GitHub keys:
ssh-keygen -R github.com - Try again:
ssh -T git@github.com
Still asking for credentials
- Double-check remote URL:
git remote -v(should start withgit@github.com:) - Make sure you’re using the right SSH key:
ssh-add -l
Quick Reference
View your public key:
cat ~/.ssh/id_ed25519.pubTest SSH connection:
ssh -T git@github.comChange remote to SSH:
git remote set-url origin git@github.com:brainforge-ai/brainforge-vault.gitList your SSH keys:
ssh-add -l