title: "SSH Keys & Deploy Keys"
description: "How to set up SSH keys for secure Git operations and deploy keys for CI/CD"
SSH Keys & Deploy Keys
OpenCodeHub supports SSH key authentication for secure Git operations without passwords.
SSH Keys (Account-Level)
SSH keys give you access to all your repositories. Use them for daily development.
Generating an SSH Key
Ed25519 (recommended):
ssh-keygen -t ed25519 -C "[email protected]"
RSA (legacy):
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Adding Your Key
Copy your public key:
cat ~/.ssh/id_ed25519.pubGo to Settings → SSH Keys in OpenCodeHub
Click New SSH Key
Paste your public key and give it a title (e.g., "Work Laptop")
Testing Your Connection
ssh -T [email protected]
You should see: Hi username! You've successfully authenticated
Note: Replace
your-server.comwith your actual OpenCodeHub server hostname or IP address.
Using SSH with Git
# Clone via SSH
git clone [email protected]:owner/repo.git
# Add SSH remote to existing repo
git remote add origin [email protected]:owner/repo.git
Deploy Keys (Repository-Level)
Deploy keys grant access to a single repository. Use them for CI/CD and deployments.
When to Use Deploy Keys
- CI/CD pipelines that need to pull code
- Deployment servers
- Automation scripts with limited access
Generating a Deploy Key
ssh-keygen -t ed25519 -C "deploy@production-server"
Adding a Deploy Key
Go to Repository → Settings → Deploy Keys
Click Add deploy key
Paste the public key and give it a title
Choose Read-only or Read/write access
Key Differences
| Feature | SSH Keys | Deploy Keys |
|---|---|---|
| Scope | All repositories | Single repository |
| Access | Full account access | Read-only or read/write |
| Use case | Daily development | CI/CD, deployment |
Troubleshooting
Permission Denied
# Check SSH agent
ssh-add -l
# Add key to agent
ssh-add ~/.ssh/id_ed25519
# Debug SSH connection
ssh -vvv [email protected]
Wrong Key Being Used
# Specify key explicitly
ssh -i ~/.ssh/id_ed25519 [email protected]
Host Key Verification Failed
# Add host to known_hosts
ssh-keyscan your-server.com >> ~/.ssh/known_hosts