SSH keys provide secure authentication for Git operations. Use them for cloning, pushing, and pulling from Kizuna repositories.
Generating SSH Keys
Ed25519 (Recommended)
bash
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/kizunaRSA (Legacy)
bash
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ~/.ssh/kizunaAdding Keys to Kizuna
Via Web UI
Copy public key:
bashcat ~/.ssh/kizuna.pubGo to Settings → SSH Keys
Click New SSH Key
Paste the public key
Add a descriptive title (e.g., "Work Laptop")
Click Add
Via API
bash
curl -X POST /api/v1/user/ssh-keys \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Work Laptop",
"key": "ssh-ed25519 AAAAC3NzaC... [email protected]"
}'Configuring SSH
SSH Config
Edit ~/.ssh/config:
Host kizuna
HostName kizuna.example.com
User git
IdentityFile ~/.ssh/kizuna
IdentitiesOnly yesUsing the Config
bash
# Clone using config
git clone kizuna:org/repo.git
# Or explicit URL
git clone [email protected]:org/repo.gitMultiple Keys
Different Keys for Different Accounts
# ~/.ssh/config
Host kizuna-work
HostName kizuna.example.com
User git
IdentityFile ~/.ssh/kizuna-work
Host kizuna-personal
HostName kizuna.example.com
User git
IdentityFile ~/.ssh/kizuna-personalClone with specific key:
bash
git clone kizuna-work:work-org/project.git
git clone kizuna-personal:personal-org/project.gitTesting SSH Connection
bash
ssh -T [email protected]
# Expected response:
# Hi username! You've successfully authenticated...Key Management
List Your Keys
bash
curl /api/v1/user/ssh-keys \
-H "Authorization: Bearer $TOKEN"Delete a Key
bash
curl -X DELETE /api/v1/user/ssh-keys/123 \
-H "Authorization: Bearer $TOKEN"Key Requirements
- Minimum 2048 bits (RSA)
- Ed25519 preferred
- Unique per user (no sharing)
Troubleshooting
Permission Denied
bash
# Test SSH agent
ssh-add -l
# Add key to agent
ssh-add ~/.ssh/kizuna
# Test connection
ssh -vT [email protected]Wrong Key Being Used
bash
# Specify key explicitly
ssh -i ~/.ssh/kizuna [email protected]
# Or use IdentitiesOnly in configKey Already in Use
Each key can only be added to one account. Generate a new key if needed.
Security Best Practices
- Use Ed25519 — Modern, secure, fast
- Password protect keys — Use passphrase
- Unique per device — Don't copy keys
- Rotate regularly — Update every 6-12 months
- Remove old keys — Clean up unused keys
Agent SSH Keys
Agents also use SSH for Git operations:
- Generate key for agent
- Add as deploy key to repository (read-only)
- Or add to agent's user account
See Deploy Keys for agent-specific keys.
Summary
SSH keys provide:
- Secure authentication — No passwords in URLs
- Convenience — No token entry for each operation
- Multi-factor — Combine with key passphrase
- Audit trail — Track which key performed actions
They're the recommended authentication method for regular Git operations.