---
title: "SSH keys and access"
url: https://docs.corefinity.com/guides/corestack-enterprise/ssh-keys-and-access
type: guide
last_updated: 2026-11-13
feature: enterprise-ssh-keys
---
# SSH keys and access

Find a CoreStack Enterprise environment's SSH command and add the public keys that may log in.

## Before you start

- You can open the environment: see [Websites and environments](/guides/corestack-enterprise/websites-and-environments).
- You have a public key of an accepted type: see [SSH keys](/guides/sites/access-and-security/ssh-keys).
- Your IP address is on the environment's firewall: see [Enterprise firewall](/guides/corestack-enterprise/firewall).

## Find the SSH command

1. **Open SSH access**

   Open the environment and choose **SSH access**. The **Connection** card has the **Host**, the **Port** and the **SSH** command for the shared username `web`.

   _Screenshot: An Enterprise environment's page on the SSH access tab: the Connection card with the Host, the Port and the SSH and SFTP commands for the shared username web, each with a Copy button._

## Add a key

1. **Open the key list**

   On **SSH access**, the list shows every key that reaches this environment, grouped by username. Choose **Add key**.

   _Screenshot: The SSH keys card with Add key ringed: the keys under the shared username web, each with its fingerprint, its source Company, Environment or Website, who added it, when it was last used and the status Applied._

2. **Paste the key**

   Paste the contents of your `.pub` file into **Public key** and enter a **Name**.

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

   Under **Who will log in with it**, choose **This environment**, **This website**, **My company** or **Me**, then choose **Add key**.

   _Screenshot: The Add a key dialog: a key pasted into Public key with its fingerprint beneath, a Name, and Who will log in with it with This environment chosen from This environment, This website, My company and Me, each saying how many environments it reaches, and the buttons Cancel and Add key._

The key reads **Applying**, then **Applied**. What each choice covers, and editing and removing a key, are as on a site: see [SSH keys](/guides/sites/access-and-security/ssh-keys).

## See a website's keys

1. **Open the website's SSH keys**

   Open the website's page and choose **SSH keys**. The list holds the keys that work on every environment of the website.

   _Screenshot: A website's page on the SSH keys tab: a line saying the keys apply to all environments of this website and to new ones, one key under This website with the status Applied, and the company's keys below, marked read-only._

## Keep or remove an older key

1. **Decide on the key**

   A key that was on the environment before keys were managed here is marked **Legacy**. Choose **Keep** to carry on using it, or **Remove**.

## 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

- [Enterprise firewall](/guides/corestack-enterprise/firewall): Allow an IP address to connect over SSH.
- [SSH keys](/guides/sites/access-and-security/ssh-keys): Add a key to log in over SSH.
- [Organisation SSH keys](/guides/organisation/access/organisation-ssh-keys): Add a key for every environment.
