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
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
CI Exit Code Lookup: What Does This Exit Code Mean?Instant lookup for CI/CD process exit codes - enter a code (137, 127, 143…) to see what it means, whether it…
Git "Host key verification failed" in CI - Fix known_hostsFix Git "Host key verification failed" in CI - the Git host is not in known_hosts, so SSH aborts before authe…