CorefinityCorefinityDocs
Open the Control PanelControl Panel
SSH access · 14 of 22

corestack_ssh_key_add

Add an SSH public key.

Scope writeRuns as a taskNo secrets returned
On this page

When to use it

Add an SSH public key. owner says where: an environment, website or company (it logs in as the shared web user) or user with your own id (it logs in as your own username everywhere you have access). Long-running: completes once every environment it reaches has the key.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_ssh_key_add with owner {"type":"company","id":4211}, public_key ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl ci@example, name Bitbucket Pipelines. (Add an SSH public key.) Tell me what it returned.

Inputs

applies_toobject

Company and website keys only — {mode: all} or {mode: selected, environment_ids}.

Fields
environment_idsarray of integers

Up to 500 items.

modestringRequired
allselected
namestringRequired

A name you will recognise the key by (at most 100 characters).

ownerobjectRequired

{type, id} — type is environment, website, company or user.

Fields
idintegerRequired

At least 1.

typestringRequired
environmentwebsitecompanyuser
public_keystringRequired

One OpenSSH line, or a PEM, RFC 4716 or PKCS#1 public key (converted). Never a private key. Up to 20,000 characters.

Example call

tools/call
{
  "name": "corestack_ssh_key_add",
  "arguments": {
    "owner": {
      "type": "company",
      "id": 4211
    },
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl ci@example",
    "name": "Bitbucket Pipelines"
  }
}

If it is refused

ReasonWhat to do
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
forbiddenAn owner of type company and the person's role lacks the Create Company SSH Keys permission (environment, website and personal keys do not ask it). The message names it and says an owner of the company can grant it in Roles; details.permission is createCompanySSHKeys. Nothing is changed.
switched_offSSH keys are not switched on for this object yet.
ssh_key_invalidNot one public key of an accepted type.
ssh_key_weakDSA, or RSA under 3072 bits.
ssh_private_key_refusedA private key was pasted; it is never stored or echoed.
ssh_key_duplicateThe same key is already there.
ssh_staff_key_refusedThe key is on Corefinity's list of staff and system keys, so it cannot be added anywhere, by anyone. No key was added. Corefinity staff can see the refused attempt (by its fingerprint, never the key itself), so if it is the person's own key, Corefinity support can check the list.
ssh_cap_exceededToo many keys; the refusal names the environment.
ssh_options_refusedThe line carries options.
ssh_key_type_unsupportedSecurity keys (sk-*) are not supported yet.
ssh_managed_on_another_environmentThis CoreStack Enterprise environment runs on the same server as another environment whose SSH the Control Panel manages, so its own keys are added, changed and removed there; the refusal's managed_on names that environment ({id, name}).
enterprise_panel_onlySSH keys for CoreStack Enterprise environments are managed in the Control Panel only at the moment.
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT