ssh_keys
Creates, updates, deletes, gets or lists a ssh_keys resource.
Overview
| Name | ssh_keys |
| Type | Resource |
| Id | linode.profile.ssh_keys |
Fields
The following fields are returned by SELECT queries:
- get
- list
An SSH Key object.
| Name | Datatype | Description |
|---|---|---|
id | integer | Read-only The unique identifier of an SSH Key object. |
created | string (date-time) | Read-only The date this key was added. (example: 2018-01-01T00:01:01) |
label | string | A label for the SSH Key. (example: My SSH Key) |
ssh_key | string (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) |
Returns a paginated list of SSH Key objects.
| Name | Datatype | Description |
|---|---|---|
id | integer | Read-only The unique identifier of an SSH Key object. |
created | string (date-time) | Read-only The date this key was added. (example: 2018-01-01T00:01:01) |
label | string | A label for the SSH Key. (example: My SSH Key) |
ssh_key | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | sshKeyId | Returns a single SSH Key object identified by id that you have access to view.Learn more... Learn more... | |
list | select | page, page_size | Returns a collection of SSH Keys you've added to your Profile. Learn more... Learn more... | |
create | insert | Adds an SSH Key to your Account profile. Learn more... Learn more... | ||
update | replace | sshKeyId | Updates an SSH Key that you have permission to read_write.Only SSH key labels can be updated. Learn more... Learn more... | |
delete | delete | sshKeyId | 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... |
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.
| Name | Datatype | Description |
|---|---|---|
sshKeyId | string | The ID of the SSHKey. |
page | integer | The page of a collection to return. |
page_size | integer | The number of items to return per page. |
SELECT examples
- get
- list
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
WHERE sshKeyId = '{{ sshKeyId }}' -- required
;
Returns a collection of SSH Keys you've added to your Profile.
Learn more...
Learn more...
SELECT
id,
created,
label,
ssh_key
FROM linode.profile.ssh_keys
WHERE page = '{{ page }}'
AND page_size = '{{ page_size }}'
;
INSERT examples
- create
- Manifest
Adds an SSH Key to your Account profile.
Learn more...
Learn more...
INSERT INTO linode.profile.ssh_keys (
label,
ssh_key
)
SELECT
'{{ label }}',
'{{ ssh_key }}'
RETURNING
id,
created,
label,
ssh_key
;
# Description fields are for documentation purposes
- name: ssh_keys
props:
- name: label
value: "{{ label }}"
description: |
A label for the SSH Key.
- name: ssh_key
value: "{{ ssh_key }}"
description: |
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)
REPLACE examples
- update
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
label = '{{ label }}'
WHERE
sshKeyId = '{{ sshKeyId }}' --required
RETURNING
id,
created,
label,
ssh_key;
DELETE examples
- delete
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
WHERE sshKeyId = '{{ sshKeyId }}' --required
;