When you use SSH to clone a GitHub repository on your server, you’re authenticating the server to GitHub using an SSH key. Here's how it's linked:
🔁 What’s Actually Happening?
- You generate an SSH key pair on your server.
- The private key stays on the server.
- The public key is copied to GitHub.
- When you run a command like:
git clone git@github.com:your-username/your-repo.git
GitHub checks:
- “Does this public key match one of the authorized SSH keys on this GitHub account?”
- If yes, access is granted, and cloning happens without asking for a username/password.
🔐 Step-by-Step: Link SSH to GitHub from Your Server
✅ 1. On your Contabo server, generate an SSH key:
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
Press Enter for all prompts to accept defaults.
✅ 2. Copy the public key:
cat ~/.ssh/id_rsa.pub
Copy the output (it begins with ssh-rsa
...).
✅ 3. Go to GitHub → Settings → SSH and GPG keys → New SSH key
- Title:
Contabo server
- Paste the key
✅ 4. Back on the server, test the connection:
ssh -T git@github.com
If successful, it will say:
Hi your-username! You've successfully authenticated...
✅ 5. Now you can clone your repo using SSH:
git clone git@github.com:your-username/your-django-repo.git tunaresq_be
No username/password will be required — it just works 🎉.