Skip to content
Discussion options

You must be logged in to vote

SSH Key Management for Multi-Repo Deployments to a Shared Server

One key per repo vs. one shared key

Best practice: one dedicated key pair per repository (or per deployment pipeline).

Reusing a single key across multiple repos is convenient, but it creates a "blast radius" problem — if one repo's secret leaks (compromised Action, malicious PR from a fork, leaked log, etc.), the attacker gets SSH access to every app on that server, not just the one that leaked. Since you're deploying to a shared VPS anyway, that's the scenario you most want to avoid.

So the general recommendation is:

  • Generate a separate ed25519 key pair per repo.
  • Add each public key to the server, but scope it down (see …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MandeepDalavi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD other General topics and discussions that don't fit into other categories, but are related to GitHub Question Ask and answer questions about GitHub features and usage Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
2 participants