# Associate an SSH Key with a VM

To associate an SSH key with a Linux storage image of a VM, follow these steps:

1\. In the **DCD**, go to **Virtual Data Centers** and select your VDC.

2\. If a VM does not exist, drag a VM element (a Dedicated Core server, a vCPU Server, or a Cube) from the palette onto the workspace based on your needs. Otherwise, you can choose to add storage to an existing VM.

3\. Click **+** on the VM to attach storage.

4\. Based on the need, associate an HDD or an SSD storage by choosing one of these options: **Create and attach HDD Storage** or **Create and attach SSD Storage**.

![Attach SSH keys with a VM's Linux image](/files/De6Y7rxTk2AJeay1ugkZ)

5\. In **Create New Attached Storage**, configure the storage and select **Linux Images** for the **Image** setting.

{% hint style="info" %}
**Note:** The option to associate SSH keys with the VM is only available when selecting a public Linux image.
{% endhint %}

![Associate an image](/files/kXiH2qPsWGQysRJFQWK3)

6\. For the **SSH Keys** setting, select from the list of SSH keys stored in the SSH Key Manager.

![Associate a key type](/files/ieGCAS2PGyW4QUhP5ioy)

7\. Click **Create HDD Storage** or **Create SSD Storage**. The option differs based on the storage type you have chosen.

{% hint style="success" %}
**Result:** The selected SSH key is associated with your VM.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/security/ssh-key-manager/connect-via-ssh/associate-ssh-key-vm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
