> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes/dcd-how-tos/connect-via-ssh/openssh-instructions-cloud-cubes.md).

# OpenSSH Instructions

### Generating an SSH key

[<mark style="color:blue;">SSH keys</mark>](https://docs.ionos.com/support/general-information/glossary-of-terms#ssh-keys) can be generated and used on macOS or Linux if both OpenSSH and the ssh-keygen command-line tools are installed. OpenSSH is a collection of tools for establishing [<mark style="color:blue;">SSH connections</mark>](/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes/dcd-how-tos/connect-via-ssh.md) to remote servers, while ssh-keygen is a utility for generating SSH keys.

An SSH key is composed of two files. The first is the private key, which should never be shared. The other is a public key that enables you to access your provisioned Cubes. When you generate the keys, you will use ssh-keygen to store them in a secure location so that you can connect to your instances without encountering the login prompt.

Manually generate SSH keys when working with OpenSSH via the Terminal application by following the steps below.

Enter the following command below into the Terminal window and press **ENTER**.

{% tabs %}
{% tab title="Bash" %}

```bash
ssh-keygen
```

{% endtab %}
{% endtabs %}

The key generation process is initiated by the command above. When you run this command, the ssh-keygen utility prompts you for a location to save the key.

Accept the default location by pressing the **ENTER** key, or enter the path to the file where you want to save the key `/home/username/.ssh/id_rsa`.

{% tabs %}
{% tab title="Bash" %}

```bash
Enter file in which to save the key (/home/username/.ssh/id_rsa):
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you have previously generated a key pair, you may see the following prompt below. If you choose to overwrite the key, you will no longer authenticate with the previous key that was generated.
{% endhint %}

{% tabs %}
{% tab title="Bash" %}

```bash
/home/username/.ssh/id_rsa already exists.
Overwrite (y/n)?
```

{% endtab %}
{% endtabs %}

Enter the passphrase that will be used to encrypt the private key file on the disk. You can also press **ENTER** to accept the default (no passphrase). However, we recommend that you use a passphrase.

Enter your passphrase once more.

After you confirm the passphrase, the public and private keys are generated and saved in the specified location. Thus, the confirmation will look like this:

{% tabs %}
{% tab title="Bash" %}

```bash
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:AcP/ieiAOoD7MjrKepXks/qHAhrRasGOysiaIR94Quk username@mb01739.local
The key's randomart image is:
+---[RSA 3072]----+
|     .o          |
|      .o         |
|..     ..        |
|.oo .   ..       |
|+=.+ . .So .     |
|X+. * . . o      |
|&Eo. *           |
|&Oo.o o          |
|@O++..           |
+----[SHA256]-----+
```

{% endtab %}
{% endtabs %}

The public key is saved to the file`id_rsa.pub`which will be the key you upload to your [<mark style="color:blue;">DCD</mark>](https://docs.ionos.com/support/general-information/glossary-of-terms#dcd) account. Your private key is saved to the `id_rsa` file in the `.ssh` directory and is used to verify that the public key you use belongs to the same DCD account.

You can copy the public key to your clipboard by running the following command:

{% tabs %}
{% tab title="Bash" %}

```bash
 pbcopy < ~/.ssh/id_rsa.pub
```

{% endtab %}
{% endtabs %}

### **Adding the SSH key to the DCD Resource Manager**

In addition to the SSH Keys stored in the [<mark style="color:blue;">SSH Key Manager</mark>](/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes/dcd-how-tos/connect-via-ssh.md#storing-ssh-keys), the IONOS Cloud Cubes SSH key concept includes:

* Default keys
* Ad-hoc SSH Keys.

Default keys are SSH keys that you intend to use frequently and have marked as such in the SSH Key Manager. When you configure storage devices, the [<mark style="color:blue;">default SSH keys</mark>](/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes/dcd-how-tos/connect-via-ssh.md#types-of-ssh-keys) are pre-selected. You can, however, specify which SSH keys are to be used before provisioning and deselect the preselected standard keys in favor of another SSH key.

Ad-hoc SSH keys, on the other hand, are SSH keys that you only use once and do not intend to save in the SSH Key Manager for future use.

The DCD's SSH Key Manager allows you to save and manage up to 100 public SSH keys for SSH access setup. This saves you from having to copy and paste the public part of an SSH key from an external source multiple times.

Log in to your DCD account after copying the SSH key to the clipboard (Link).

1\. Open the SSH Key Manager: **Menu** > **Management** > **SSH Keys**

![Accessing the SSH Key Manager from the Data Center Designer](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-a2aab380718de28b73015168f489ac2ce11a3a86%2Faccess_ssh.png?alt=media)

2\. Select the **+ Add Key** in the top left corner.

![Adding an SSH Key to the Manager](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-45c1fb56a0f6e87ebdba8a35e65bcd7d8b44a6c8%2Fadd_ssh.png?alt=media)

3\. Paste the SSH key from the clipboard into the **SSH Key** field. If you have saved your SSH Key in a file, you can upload it by selecting the **Choose file** button in the **Select Key file** field.

![Copy and paste key info in the SSH Key field.](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-8097e9338f88ae161023164ee288aa302aae5f8d%2Fselect_keyfile.png?alt=media)

{% hint style="info" %}
Make sure the SSH keys you enter are valid. The DCD does not validate the syntax or format of the keys.
{% endhint %}

***Optional**:* Select the **Default** checkbox to have the SSH key pre-selected when configuring SSH access.

4\. Click **Save** to save the key. The SSH key has now been saved in the SSH Key Manager and is visible in the SSH Key Manager's table of keys.

### Connecting via OpenSSH

You can connect to your Cubes instance via OpenSSH. Still, you will need the terminal application, which varies depending on your operating system. For:

* Linux: Search Terminal or press **CTRL+ALT+T**
* macOS: Search Terminal
* Windows: Search Bash. If you don’t have Bash installed, use PuTTY instead.

The steps below will show you how to connect to your Cubes.

Open the Terminal application and enter the SSH connection command below. After the `@`, add the [<mark style="color:blue;">IP address</mark>](https://docs.ionos.com/support/general-information/glossary-of-terms#ip-address) of your Cubes instance. Then press **ENTER**.

{% tabs %}
{% tab title="Bash" %}

```bash
ssh root@85.215.230.154
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
When you log in for the first time, the server isn't recognized on your local machine, so you'll be asked if you're sure you want to keep connecting. You can type yes and then press **ENTER**.
{% endhint %}

Authentication is the next step in the connection process. If you've added the SSH keys, you'll be able to connect to the Cubes immediately or after entering your key pair's passphrase.

If you haven't already added SSH keys, you'll be asked for your password:

{% tabs %}
{% tab title="Bash" %}

```bash
root@85.215.230.154's password:
```

{% endtab %}
{% endtabs %}

Nothing is displayed in the terminal when you enter your password, making it easier to paste in the initial password. Pasting into text-based terminals is different from other desktop applications. It is also different from one window manager to another:

* For Linux Gnome Terminal, use **CTRL+SHIFT+V**.
* For macOS, use the **SHIFT-CMD-V** or a middle mouse button.
* For Bash on Windows, right-click on the window bar, choose **Edit**, then **Paste**. You can also right-click to paste if you enable QuickEdit mode.

Once you’ve entered the password, press **ENTER**.

If the SSH key is configured correctly, this will log you into the [<mark style="color:blue;">Cloud Cubes</mark>](/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/~/revisions/bM7yG7XCmGE9IxWqMpBu/compute/cloud-cubes/dcd-how-tos/connect-via-ssh/openssh-instructions-cloud-cubes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
