# Connect EC2 instance

Once an EC2 Instance is created, you connect it with SSH either by using Session ID or by downloading a key.

## Connecting to an EC2 Linux instance using SSH

In the DuploCloud Portal, navigate to **Cloud Services** -> **Hosts** and select the host to which you want to connect.

### Connect using session ID

After you select the Host, on the Host's page click the **Actions** menu and select **SSH**. A new browser tab opens and you can connect your Host using SSH with by session ID. Connection to the host launches in a new browser tab.

### Connect by downloading a key

1. After you select the Host, on the Host's page click the **Actions** menu and select **Connect** -> **Connection Details**. The **Connection Info for Host** window opens. Follow the instructions to connect to the server.
2. Click **Download Key**.

<div align="left"><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FEZNlcZEikswI0m64BkqF%2Fimage.png?alt=media&#x26;token=b30efc7d-5743-43c4-afe6-e230bf1f6d4d" alt="Connection Info for Host window with Download Key button"></div>

## Disable the option to download the SSH key

If you don't want to display the **Download Key** button, disable the button's visibility.

1. In the DuploCloud Portal, navigate to **Administrator** -> **System Settings**.
2. Click the **System Config** tab.
3. Click **Add**. The **Add Config** pane displays.
4. From the **Config Type** list box, select **Flags**.
5. From the **Key** list box, select **Disable SSH Key Download**.
6. From the **Value** list box, select **true**.
7. Click **Submit**.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FGdJilI0twTbJXBUF2Myu%2Fimage.png?alt=media&#x26;token=7f6d40c8-3cd2-4d03-a877-50c4c524aee0" alt=""><figcaption><p><strong>Add Config</strong> pane with <strong>Disable SSH Key Download Key</strong> selected</p></figcaption></figure></div>

## Configuring admin-only access to the SSH key

Configuring the following system setting disables SSH access for read-only users. Once this setting is configured, only administrator-level users can access SSH.

1. From the DuploCloud Portal, navigate to **Administrator** -> **Systems Settings**.
2. Select the **Settings** tab, and click **Add**. The **Update Config Flags** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FChpv8SIdi1eNOASEj8YY%2Fupdate%20configu%20flag.png?alt=media&#x26;token=45d63900-14ce-4d81-b2f0-1751ded0c0b1" alt=""><figcaption><p>The <strong>Update Config Flags</strong> pane</p></figcaption></figure></div>
3. From the **Config Type** list box, select **Flags**.
4. In the **Key** list box, select **Admin Only SSH Key Download**.
5. In the **Value** field list box, select **true**.
6. Click **Submit**. The setting is configured and SSH access is limited to administrators only.


---

# 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.duplocloud.com/docs/automation-platform/overview/use-cases/hosts-vms/ssh-ec2-instance.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.
