Skip to content
Railway SSH Security — Staging-Only Access, Session Revocation and Isolation
kokaalbin-oss
OP

an hour ago

Hello Railway Support,

We're preparing a secure, owner-authorized staging release for our Medusa e-commerce application.

Our Railway project contains both staging and production environments.

We need to run a GitHub Actions security verification and PostgreSQL backup without granting access to production.

Could you please confirm:

  1. Can an SSH key or dedicated Railway identity be restricted to one service in one environment (staging only)?
  2. Does Railway enforce that restriction for SSH access through ssh.railway.com, including access to mounted volumes?
  3. Is this possible on our current plan, or does it require Enterprise?
  4. If staging-only SSH permissions are unavailable, what secure alternative do you recommend for automated verification and PostgreSQL backups without exposing our database publicly?
  5. Does removing a registered SSH key terminate existing authenticated sessions, or only prevent new connections?

We want to preserve production isolation and avoid granting a GitHub Actions credential workspace-wide access.

Please clarify which restrictions Railway currently guarantees and which are unsupported.

Thank you.

Solved

1 Reply

Railway
BOT

an hour ago

SSH keys cannot be restricted to one service or one environment. A personal key gives the same access as your own user permissions, and a workspace key gives SSH access to every service in the workspace. SSH and SCP/SFTP also reach the container's filesystem, which includes any mounted volume. So a key you register for GitHub Actions would also be able to reach production.

Every SSH session also gets a RAILWAY_API_TOKEN so the CLI can sign in as the key's user. That token has the user's full permissions and is not limited to the staging service you connected to. For ordinary service sessions, it expires one hour after it is issued.

For CI, the narrowest credential we offer is a project token (RAILWAY_TOKEN). It is limited to one environment and to deployment actions like railway up, railway redeploy and railway logs. It cannot run SSH or manage SSH keys.

We have not confirmed two things here. First, whether deleting a key ends sessions that are already connected or only blocks new ones. Second, whether a scoped SSH identity is available on any plan. Because of this, plan your production isolation around the scoping limits above rather than counting on key removal to cut off an active session. Also note that an SSH token already issued is not revoked when you delete the key. It stays valid until it expires.


Status changed to Awaiting User Response Railway • about 1 hour ago


Status changed to Solved kokaalbin-oss • about 1 hour ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...