Add an SSH public key
add_ssh_keyRegisters an OpenSSH public key to the API key's person so they can connect to SSH-enabled computers, with optional challenge-signature proof.
Instructions
Register an OpenSSH public key to the person this API key belongs to. It is accepted only by computers with SSH on in the account this credential acts on, and is removed when the credential is revoked. Accepted: Ed25519, ECDSA (P-256, P-384, P-521), their security-key forms, and RSA of at least 3072 bits. Refused: DSA, shorter RSA, certificates, a line with SSH options in front of the key, and anything but one key on one line. A key can belong to one person only, and each person may hold eight. Never send a PRIVATE key. PROOF: without challenge and signature the key is UNPROVEN and connects to a computer named by its id only (a computer named by its name is refused). To make it proven, call ssh_key_challenge, have the person run its sign_command with their private key file, and send the challenge and the signature it prints here; a key already registered without proof, to anyone, is then replaced and registered to this person.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"public_key": "<public_key>"
},
"name": "add_ssh_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | A label, up to 60 characters. Defaults to the comment on the line. | |
| challenge | No | A challenge from ssh_key_challenge, exactly as issued (sshkc-…). Send it with signature, or leave both out. A challenge is not a credential: it is single-use and only for this person. | |
| signature | No | The armored signature the challenge's sign_command printed, from -----BEGIN SSH SIGNATURE----- to -----END SSH SIGNATURE-----, made with this key. Send it with challenge, or leave both out. | |
| public_key | Yes | One line from a .pub file: "<type> <base64> [comment]". The file's contents can be passed as read: surrounding whitespace, including a trailing newline, is dropped. The comment is dropped too. |