Skip to content

RunPod pods cannot authenticate with the configured SSH key #1202

Description

@morluto

Summary

With provider: runpod, Crabbox can create a pod that reaches RUNNING and exposes a public TCP mapping for port 22, but SSH key authentication fails even when ssh.key points to a private key with a valid adjacent .pub file.

In two Crabbox 0.38.0 provisioning attempts, the created pods exposed port 22 but reported PUBLIC_KEY as the literal string null. SSH readiness could not authenticate with the configured key.

Reproduction

Configure a RunPod provider and a local SSH key:

provider: runpod
ssh:
  key: /path/to/id_ed25519

Ensure /path/to/id_ed25519.pub exists, then create a RunPod lease:

crabbox warmup --provider runpod --keep

The pod reaches RUNNING with a public port 22 mapping, but the configured key is not authorized and SSH readiness cannot complete.

Root cause

The RunPod acquire path sets StartSSH: true on its internal deploy input, but that field is not serialized by runpodDeployPayload. The configured ssh.key is only used later by the local SSH client; its public half is never added to the POST /pods request.

The request therefore has no env.PUBLIC_KEY value:

ssh.key -> local SSH identity
        \-> (missing) POST /pods env.PUBLIC_KEY

RunPod's official container startup script only appends PUBLIC_KEY to ~/.ssh/authorized_keys and starts SSH when that value is present:

https://github.com/runpod/containers/blob/0e47720fce6ccf75703e5f5068e90dc817492ae7/container-template/start.sh

The RunPod REST API supports an env object on pod configuration:

https://docs.runpod.io/api-reference/pods/POST/pods

This makes the failure deterministic at the request boundary: a configured Crabbox key cannot become an authorized pod key because its public value is absent from the deploy payload.

Expected behavior

Before creating a paid pod, Crabbox should read the public half of the configured SSH key and fail clearly if it is missing or empty. The RunPod deploy request should serialize that value as env.PUBLIC_KEY, allowing the official image to populate authorized_keys and start SSH for the same identity Crabbox uses locally.

Impact

Affected RunPod leases can consume provisioning time and reach a nominally running state while remaining unusable to Crabbox's SSH transport. Exporting PUBLIC_KEY in the caller's shell does not repair this path because the provider constructs the pod environment explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions