Skip to main content

ssh_keys

Creates, updates, deletes, gets or lists a ssh_keys resource.

Overview

Namessh_keys
TypeResource
Idlinode.profile.ssh_keys

Fields

The following fields are returned by SELECT queries:

An SSH Key object.

NameDatatypeDescription
idintegerRead-only The unique identifier of an SSH Key object.
createdstring (date-time)Read-only The date this key was added. (example: 2018-01-01T00:01:01)
labelstringA label for the SSH Key. (example: My SSH Key)
ssh_keystring (ssh-key)The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy. Accepted formats: - ssh-dss - ssh-rsa - ecdsa-sha2-nistp - ssh-ed25519 - sk-ecdsa-sha2-nistp256 (Akamai-specific) (example: ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ssh_keyselectReturns a single SSH Key object identified by id that you have access to view.

Learn more...

Learn more...
get_ssh_keysselectpage, page_sizeReturns a collection of SSH Keys you've added to your Profile.

Learn more...

Learn more...
post_add_ssh_keyinsertAdds an SSH Key to your Account profile.

Learn more...

Learn more...
put_ssh_keyreplaceUpdates an SSH Key that you have permission to read_write.

Only SSH key labels can be updated.

Learn more...

Learn more...
delete_ssh_keydeleteDeletes an SSH Key you have access to.

> 📘
>
> This operation only deletes a key's association from your profile. It doesn't remove it from any Linode or disk that was deployed with authorized_keys. You need to manually delete the key on the Linode or disk.

Learn more...

Learn more...

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples

Returns a single SSH Key object identified by id that you have access to view.

Learn more...

Learn more...

SELECT
id,
created,
label,
ssh_key
FROM linode.profile.ssh_keys;

INSERT examples

Adds an SSH Key to your Account profile.

Learn more...

Learn more...

INSERT INTO linode.profile.ssh_keys (
data__label,
data__ssh_key
)
SELECT
'{{ label }}',
'{{ ssh_key }}'
RETURNING
id,
created,
label,
ssh_key
;

REPLACE examples

Updates an SSH Key that you have permission to read_write.

Only SSH key labels can be updated.

Learn more...

Learn more...

REPLACE linode.profile.ssh_keys
SET
data__label = '{{ label }}'
WHERE

RETURNING
id,
created,
label,
ssh_key;

DELETE examples

Deletes an SSH Key you have access to.

> 📘
>
> This operation only deletes a key's association from your profile. It doesn't remove it from any Linode or disk that was deployed with authorized_keys. You need to manually delete the key on the Linode or disk.

Learn more...

Learn more...

DELETE FROM linode.profile.ssh_keys;