Skip to content
Latchkey

SSH Exit Code 255 in CI: Connection or Auth Failure

SSH exit code 255 means ssh itself failed to connect or authenticate - it is not a status from the remote command.

A step exiting 255 from ssh never ran (or never reached) the remote command; the SSH session setup failed.

What it means

ssh reserves 255 for its own fatal errors: connection refused, network unreachable, host-key verification failure, or authentication failure. Any other code is the remote command's own exit status.

Common causes

  • Host key mismatch or unknown host.
  • Wrong key, user, or rejected auth.
  • The host was unreachable or refused the connection.

How to fix it

Re-run with ssh -v to see where setup fails; fix the key, known_hosts entry, or network path. A transient network/host blip can clear on retry - Latchkey auto-retries these mechanical connection failures.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →