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

# SSH Keys

> How to save SSH public keys in the Ascienth console and add them to a server when you order or reinstall it.

## Overview

The "SSH Keys" page stores the public keys you use to log in to your servers. A saved key does nothing on its own. It is added to a server only when you pick it while ordering a new server or reinstalling an existing one.

Open the Ascienth console at [https://console.advinservers.com](https://console.advinservers.com) and click "SSH Keys" under "Setup" in the left sidebar.

Keys are saved in the team you are working in. Each team has its own list, so switch to the right team before you add a key.

<Note>
  We only store your **public** key. Never paste a private key into the console. A private key is rejected.
</Note>

## Supported Keys

Paste the contents of your `.pub` file, for example `ssh-ed25519 AAAA... you@laptop`. We accept:

| Key type | Accepted |
| - | - |
| Ed25519 (`ssh-ed25519`) | Yes |
| ECDSA (`ecdsa-sha2-nistp256` and similar) | Yes |
| RSA (`ssh-rsa`) | Yes, 1024 bits or longer |
| DSA (`ssh-dss`) | No |

The console also tidies up common copy-and-paste problems for you:

* A key that was split across several lines is joined back into one line.
* A key pasted without its type at the start has the type added back.
* A public key in PEM format (`BEGIN PUBLIC KEY`) or exported from PuTTY is converted to the one-line OpenSSH format.

If the key still cannot be read, you will see: `That does not look like an SSH public key. Paste the contents of a .pub file, for example "ssh-ed25519 AAAA… you@laptop".`

## Adding a Key

<Steps>
  <Step title="Open the form">
    On the "SSH Keys" page, click `Add SSH Key`.
  </Step>

  <Step title="Fill in the key">
    * `Name`: a label for the key, up to 64 characters. Each name can only be used once in your account.
    * `Public key`: the full public key, up to 4096 characters.
    * `Default`: tick this to have the key selected for you on the order and reinstall forms. You can mark more than one key as default.
  </Step>

  <Step title="Save">
    Click `Create`. The key appears in the list with its type and its `SHA256:` fingerprint, which you can compare against `ssh-keygen -lf <keyfile>` on your computer.
  </Step>
</Steps>

You can also add a key straight from the order or reinstall form with `Create SSH Key`. The new key is selected for you.

## Editing a Key

Click the menu at the end of the key's row and choose `Edit`. You can change the name, replace the key itself, and turn `Default` on or off. Click `Save` when you are done.

<Warning>
  Editing a key does not change servers that already have it. They keep the old key until you reinstall them. To rotate a key on a running server, update `~/.ssh/authorized_keys` on the server yourself.
</Warning>

## Deleting a Key

Click the menu at the end of the key's row and choose `Delete`. To confirm, type the key's name and click `Delete`.

<Warning>
  Deleting a key only removes it from the console. Servers that already have the key still accept it. To revoke access, remove the key from `~/.ssh/authorized_keys` on each server, or reinstall the server.
</Warning>

## Where Keys Are Used

Saved keys appear as tiles in the "SSH Keys" section of two forms:

* **Ordering a server**, on the "Order a Server" page. Keys marked `Default` are selected for you.
* **Reinstalling a server**, on the server's "Reinstall" tab. Keys marked `Default` are selected for you. If you have no default keys, all of your keys are selected. See [Server Reinstallation](/guides/reinstall).

Click a tile to select or clear it. You can add up to 25 keys to one server.

When a server is built with at least one SSH key, password login over SSH may be turned off on the new server, so sign in with your key. Your root password still works on the server's console.

<Note>
  Windows servers do not use SSH keys. The "SSH Keys" section is hidden when you pick a Windows operating system. See [Windows](/guides/windows).
</Note>

## Team Permissions

The team owner can always manage keys. Members need these permissions in their role:

| Permission | Allows |
| - | - |
| `View SSH keys` | See the keys saved in the team. |
| `Manage SSH keys` | Add and edit keys. |
| `Delete SSH keys` | Delete a saved key. |

If the team owner has more than one team, they can also choose `Move to team` from a key's menu to move it to another of their teams. See [Team Members and Roles](/guides/team-members).

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="I added a key but cannot log in to my existing server.">
    Saved keys are only added when a server is ordered or reinstalled. For a server that is already running, add the key to `~/.ssh/authorized_keys` on the server yourself.
  </Accordion>

  <Accordion title="Can I save the same key twice?">
    Yes, as long as each copy has a different name. This can help if you want one entry per machine the key belongs to.
  </Accordion>

  <Accordion title="Why was my RSA key rejected?">
    RSA keys shorter than 1024 bits are refused because the server cannot use them. Generate a new key, for example with `ssh-keygen -t ed25519`.
  </Accordion>
</AccordionGroup>

## Using the API

You can manage keys with an API key that has the `View SSH keys`, `Manage SSH keys` or `Delete SSH keys` permission for its team.

```bash theme={null}
curl https://console.advinservers.com/api/v1/client/ssh-keys \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name": "Laptop", "public_key": "ssh-ed25519 AAAA... you@laptop", "is_default": true}'
```

See the [API introduction](/api-reference/introduction) for how to create a key and for the full list of endpoints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.