Get Agent Key Registration Code
Return your registration code and the commands that sign it. To register an agent key, sign the code with the key and send the output. The code is yours, for your active account: a key registered with it logs in as you there.
Preview. An agent key logs a tunnel in instead of a token. See Key authentication.
Requires the endpoints:write permission on the active account: the same permission that registers a key.
Response (200 OK)
code string
The code to sign, for example
z64z-ocgv-ijmk-3nx7-wku5. Sign it with ngris key sign <code>.statement string
The full text to sign with OpenSSH instead of
ngris key sign. Sign it unchanged.namespace string
The value the OpenSSH commands pass to
-n. Always ngris-agent-key.commands.ngris string
The command to run:
ngris key sign <code>. It signs with the key the agent is set up with, else ~/.config/ngris/agent_key.commands.unix string
The OpenSSH command for macOS and Linux (OpenSSH 8.1 or newer), for the key at
~/.config/ngris/agent_key.commands.powershell string
The OpenSSH command for Windows PowerShell (OpenSSH 8.1 or newer), for the key at
$HOME\.config\ngris\agent_key.Each command prints a -----BEGIN SSH SIGNATURE----- block: send it as signature to Register Agent Key. If your key is in another place, add --private-key-file <file> to the ngris command, or change the path in the OpenSSH command.
Errors
401 Unauthorized
Missing auth.
403 Forbidden
The caller lacks the
endpoints:write permission in the active account.Request
curl "https://api.ngris.com/v1/security/agent-keys/statement" \
-H "X-API-KEY: <your_api_key>"
Response — 200 OK
{
"statement": "ngris key v1 z64z-ocgv-ijmk-3nx7-wku5",
"code": "z64z-ocgv-ijmk-3nx7-wku5",
"namespace": "ngris-agent-key",
"commands": {
"ngris": "ngris key sign z64z-ocgv-ijmk-3nx7-wku5",
"unix": "printf '%s' 'ngris key v1 z64z-ocgv-ijmk-3nx7-wku5' | ssh-keygen -Y sign -n ngris-agent-key -f ~/.config/ngris/agent_key",
"powershell": "'ngris key v1 z64z-ocgv-ijmk-3nx7-wku5' | ssh-keygen -Y sign -n ngris-agent-key -f $HOME\\.config\\ngris\\agent_key"
}
}
Sign it
ngris key sign z64z-ocgv-ijmk-3nx7-wku5
-----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAg7pjCaIQOjlxjVBrDROsUTXugjc
SYYrP71oZNt3kgJgkAAAAPbmdyaXMtYWdlbnQta2V5AAAAAAAAAAZzaGE1MTIAAABTAAAA
C3NzaC1lZDI1NTE5AAAAQOZOZISqHXKisFRNHQQ+Kssj9CkfWz68O4PfckmDWllFi6TZDT
BQLo4Fr/fWB9v2Y21XsVrIDH9Fd7yD6MrbXgk=
-----END SSH SIGNATURE-----
Was this helpful?