Skip to content
ecdsa.com

SSHSIG (SSH signatures)

OpenSSH's format for signing arbitrary data with SSH keys (ssh-keygen -Y sign), which binds a namespace to each signature and underlies SSH-signed Git commits and allowed-signers verification.
Also written asSSHSIGssh-keygen -Y signSSH signaturePROTOCOL.sshsig

The signed data is the 6-byte magic SSHSIG, the namespace string (for example git or file), a reserved field, the hash algorithm (sha256 or sha512) and the message digest; the namespace prevents a signature made for one purpose from being replayed in another. The output is armored between -----BEGIN SSH SIGNATURE----- and -----END SSH SIGNATURE----- and contains the public key, so verifiers must check it against a trusted list rather than accept the embedded key.

ssh-keygen -Y verify -f allowed_signers -I identity -n namespace -s file.sig checks a signature; -Y find-principals maps a signature to identities. Ed25519, ECDSA, RSA (with rsa-sha2-*) and FIDO sk- keys work, so a security key can sign commits with a touch. The SSH signature verifier runs the same checks locally.

Standards and references

All terms