Skip to main content

authkey

The authkey command manages the trusted SSH public keys on the DisplayNet Server. Only clients with trusted public keys can access the API via SSH.

SSH connections to the API use the api user, for example ssh api@displaynet.local.

Command TypeDisplayNet
Minimum Version2.x.x
Requires the Admin role

Usage

authkey list
authkey add ssh-rsa <key> <name>
authkey remove <name>

Subcommands

SubcommandDescription
listLists the trusted SSH keys, showing each key's name
addAdds a new SSH key with the provided key and name
removeRemoves an existing SSH key by name

Arguments

ArgumentRequiredDescription
keyaddThe SSH public key. Must be in RSA format, beginning with ssh-rsa.
nameadd, removeThe name used to reference the key.
Paste the .pub file directly

The contents of an RSA .pub file can be pasted directly as the authkey add argument list. It already has the ssh-rsa <key> <name> form, with the name typically in user@host format.

Examples

Trust a client's public key
authkey add ssh-rsa AAAAB3NzaC1yc2EAAA... dnuser@laptop
Revoke a key
authkey remove dnuser@laptop

Return value

authkey list
{
"status": "SUCCESS",
"request_id": null,
"result": {
"pubkeys": [
{
"name": "dnuser@laptop"
},
{
"name": "apiuser@devbox"
}
]
},
"error": null
}

REST API

Endpoint typeDisplayNet API command
AddressPOST /api/displaynet/<operation>, or name the operation in the body of a POST /api/displaynet. See Sending commands.
RoleAdmin
SubcommandOperationParameters
addauthkey_addssh pubkey keyname
listauthkey_list
removeauthkey_removekeyname

See also