Assign SSH Keys
The following explains how to alter the list of SSH keys which are automatically added to the list of authorised keys during the OS Reload process. Once any changes have been made to the list a fresh OS Reload must be requested for the keys to be added or removed. Furthermore, any keys manually added to the server will be wiped during the OS Reload. In order to assign an SSH key to a server it must first be added to the account. Instructions on how to add keys can be found here.
Method
Assign Keys
-
Navigate to the relevant server page, select the SSH Keys tab.
-
Use the dropdown field to select the SSH keys you want to deploy to the server.
-
Click “Assign Keys”.
-
Once complete, a green pop-up message will confirm the success of the action.
Unassign Keys
-
Navigate to the relevant server page, select the SSH Keys tab.
-
Use the cross on each SSH key item to deselect it from the list.
-
If all keys have been removed, click ‘Unassign All Keys’. Otherwise, click ‘Assign Keys’.
-
Once complete, a green pop-up message will confirm the success of the action.
Assign
curl --request PATCH \--url https://api.ingenuitycloudservices.com/rest-api/servers/{server_id}/ssh-keys/assign \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'X-Api-Token: API_KEY' \--data '{"ssh_key_ids":[1,2,3]}'
Unassign
curl --request PATCH \--url https://api.ingenuitycloudservices.com/rest-api/servers/{server_id}/ssh-keys/un-assign \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'X-Api-Token: API_KEY' \--data '{"ssh_key_ids":[4,5,6]}'