# Connect to Virtual Machines via SSH

You can connect to the [<mark style="color:blue;">VM</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#vm) through [<mark style="color:blue;">Secure Shell (SSH) Keys</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#secure-shell-ssh-keys) in the following ways:

1\. **Generate an SSH Key:** Use this key to connect to a VM using SSH without entering a password. The SSH client uses the private key to authenticate with the VM, and the VM then uses the public key to verify the client's identity. For more information, see [<mark style="color:blue;">Generate SSH Keys</mark>](/cloud/security/ssh-key-manager/connect-via-ssh/generate-ssh-key.md).

2\. **Store the Default SSH Key:** Save the SSH key in the DCD for reusing it. Saving and reusing the key is not applicable for an **Ad-hoc SSH key**. For more information, see [<mark style="color:blue;">Manage SSH Keys</mark>](/cloud/security/ssh-key-manager/connect-via-ssh/manage-ssh-keys.md).

3\. **Attach a Linux Storage Image:** Add an HDD or an SSD storage with a VM and associate either a key saved in the **DCD SSH keys view** or an **Ad-hoc** SSH key with it. You can choose an appropriate SSH key by selecting the respective checkbox. An **Ad-hoc SSH key** must be entered manually. For more information, see [<mark style="color:blue;">Associate an SSH Key with a VM</mark>](/cloud/security/ssh-key-manager/connect-via-ssh/associate-ssh-key-vm.md).

4\. **Establish Connection:** Connect to your VM (Linux) instance using an SSH client of your choice. An SSH client is a collection of tools for establishing SSH connections to remote servers. For example, `OpenSSH`, `PUTTY`, and so on. For more information, see [<mark style="color:blue;">Connect to your VM (Linux) instance via an SSH Client</mark>](/cloud/security/ssh-key-manager/connect-via-ssh/connect-via-ssh-terminal.md).


---

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