> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SSH Key Credentials

> Store or generate SSH keys in Ankra for server access on provisioned self-managed clusters.

SSH key credentials store public keys that are deployed to servers during cluster provisioning. You can either provide your own public key or let Ankra generate a keypair for you. They're required for self-managed clusters on providers such as [Hetzner](/platform/credentials/hetzner), [OVH](/platform/credentials/ovh), [DigitalOcean](/platform/credentials/digitalocean), [UpCloud](/platform/credentials/upcloud), [Proxmox](/platform/credentials/proxmox), and [Morpheus](/platform/credentials/morpheus).

## Creating an SSH Key Credential

<Steps>
  <Step title="Choose an approach">
    * **Bring your own key**: provide an existing SSH public key
    * **Generate a keypair**: Ankra generates a new Ed25519 keypair and returns the private key for you to save
  </Step>

  <Step title="Add to Ankra (UI)">
    Go to **Credentials** → **Add** → **SSH Key**, enter a name, and either paste your public key or choose **Generate**.
  </Step>

  <Step title="Or via CLI">
    ```bash theme={null}
    # Generate a new keypair (via Hetzner credentials)
    ankra credentials hetzner ssh-key create --name my-key --generate

    # Generate a new keypair (via OVH credentials)
    ankra credentials ovh ssh-key create --name my-key --generate

    # Or provide your own public key
    ankra credentials hetzner ssh-key create --name my-key \
      --public-key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5..."
    ```
  </Step>
</Steps>

<Warning>
  When generating a keypair, the private key is only returned once. Save it immediately to a secure location.
</Warning>

## Listing SSH Key Credentials

<CodeGroup>
  ```bash CLI theme={null}
  ankra credentials hetzner ssh-key list
  ```

  ```bash cURL theme={null}
  curl https://platform.ankra.app/api/v1/credentials/hetzner/ssh-keys \
    -H "Authorization: Bearer $ANKRA_API_TOKEN"
  ```
</CodeGroup>
