---
title: "SSH keys"
url: https://docs.corefinity.com/guides/sites/access-and-security/ssh-keys
type: guide
last_updated: 2026-11-13
feature: ssh-keys
related:
  - https://docs.corefinity.com/api/reference/access/get-company-ssh.md
  - https://docs.corefinity.com/api/reference/access/list-company-legacy-ssh-keys.md
  - https://docs.corefinity.com/api/reference/access/get-own-company-ssh.md
  - https://docs.corefinity.com/api/reference/access/get-environment-ssh.md
  - https://docs.corefinity.com/api/reference/access/list-environment-ssh-activity.md
  - https://docs.corefinity.com/api/reference/access/get-environment-ssh-host-keys.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_ssh_key_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_ssh_key_create.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_ssh_key_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_ssh_key_delete.md
  - https://docs.corefinity.com/mcp/tools/corestack_ssh_keys_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_ssh_login_get.md
---
# SSH keys

Add a public key so a person or a server can log in to a site over SSH, and remove it when it is no longer needed.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can add and remove its SSH keys.
- You have a public key of an [accepted type](#accepted-key-types).
- To connect, your IP address must also be on the site's [firewall](/guides/sites/access-and-security/firewall).

## Add a key

1. **Open Users & keys**

   Go to **Managed Websites**, choose the site, then **Users & keys** under **Access & security**. Each environment has its own keys: check the environment in the site header.

   _Screenshot: A site page on its Production environment with Users & keys ringed in the menu, and the SSH keys card listing the keys under each username with their source, who added them, when each was last used and their status._

2. **Paste the public key**

   Choose **Add key** and paste the contents of your `.pub` file into **Public key**. Enter a **Name** that says who or what uses the key, such as `Daniel's ThinkPad`.

   _Screenshot: The Add a key dialog: Public key, Name, and Who will log in with it with the choices This environment, This website, My company and Me._

3. **Choose who will log in with it**

   Under **Who will log in with it**, choose where the key works. Each choice shows how many environments it covers.

   | Choice               | Logs in as                | Works on                                                   |
   | -------------------- | ------------------------- | ---------------------------------------------------------- |
   | **This environment** | The shared username `web` | This environment only                                      |
   | **This website**     | The shared username `web` | Every environment of this website                          |
   | **My company**       | The shared username `web` | Every environment of your organisation, including new ones |

   **Me** logs in as your own username, on every environment you can reach.

4. **Add the key**

   Choose **Add key**, then **Done**. The key appears in the list as **Applying**, then **Applied**.

   _Screenshot: The SSH keys card: the keys under the shared username web, then those under a personal username, each with its fingerprint, source, who added it, when it was last used and the status Applied._

> **Note:** **My company** needs the **Create Company SSH Keys** permission. Owners always have it; an owner can give it to other roles in **Roles**.

## Connect

1. **Copy the SSH command**

   Choose **Connection details** under **Access & security** and copy the command under **SSH**.

   A key added as **Me** logs in with **Your username** in place of `web`.

   _Screenshot: The Connection card with the host, port, your username, the shared username web and the SSH command with a Copy button._

## Remove a key

1. **Open the key's menu**

   In **Users & keys**, open the **…** menu on the key and choose **Remove…**.

   _Screenshot: The SSH keys card with the menu open on the key Daniel's ThinkPad: Edit…, Copy fingerprint and Remove…._

2. **Confirm with the key's name**

   Enter the name under **Type the key's name to confirm** and choose **Remove key**. The key shows **Removing** until it is gone.

   _Screenshot: The Remove Daniel's ThinkPad? dialog: Removes it from Production, the key's fingerprint, the box Type the key's name to confirm, and the buttons Cancel and Remove key._

A key from another source is changed where it was added. Follow the link on its row:

| Source      | Link                     |
| ----------- | ------------------------ |
| **Company** | **Edit at your company** |
| **Website** | **Edit at the website**  |

Keys for every environment of the organisation are on [Organisation SSH keys](/guides/organisation/access/organisation-ssh-keys).

A **Personal** key of your own has the link **Your keys: edit in your profile**: see [Your SSH keys](/guides/your-account/your-ssh-keys).

## Accepted key types

A key is ed25519, ECDSA, or RSA of 3072 bits or more. DSA keys, shorter RSA keys, hardware-backed `sk-` keys and keys with options are refused.

To make a key, run `ssh-keygen -t ed25519` and use the `.pub` file.

## Automate this

**API:** [Create an SSH key](https://docs.corefinity.com/api/reference/access/create-ssh-key.md), scope `write`

```bash
curl -X POST https://manage.corefinity.com/api/ssh/keys \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "applies_to": {
      "environment_ids": [
        1311
      ],
      "mode": "selected"
    },
    "name": "Build server",
    "owner": {
      "id": 1204,
      "type": "company"
    },
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAAAExampleKeyOnlyDoNotUseThisIsNotARealKey2"
  }'
```

**MCP:** [`corestack_ssh_key_add`](https://docs.corefinity.com/mcp/tools/corestack_ssh_key_add.md), scope `write`

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

**Control Panel:** Managed Websites › your site › Access & security › Users & keys ([https://manage.corefinity.com/go/ssh-keys](https://manage.corefinity.com/go/ssh-keys))

## Related

- [Firewall](/guides/sites/access-and-security/firewall): Allow an IP address to reach a site.
- [Connection details](/guides/sites/access-and-security/connection-details): Find the host, port and commands.
- [SSH and SFTP users](/guides/sites/access-and-security/ssh-and-sftp-users): Give someone their own sign-in to a site.
