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

# Establish SSH connection to a Virtual Instance

SSH key pairs authenticate connections to Linux Virtual Instances. After generating SSH keys and adding a public key to the [Gcore Customer Portal](https://portal.gcore.com), use the key to connect to the instance.

Before proceeding, confirm that:

* If the Virtual Instance is only connected to a private network, it has a [floating IP address](/cloud/networking/ip-address/create-and-configure-a-floating-ip-address).
* The [necessary protocols in firewall settings](/cloud/networking/add-and-configure-a-firewall#use-the-default-firewall) are configured to allow outgoing and incoming connections to the instance.

## Connect from terminal, command prompt, or WSL

Follow these instructions to connect to a Virtual Instance from Linux, macOS, or Windows 10/11 devices:

1. Open Terminal (Linux, macOS), Windows Subsystem for Linux, or Command Prompt (cmd.exe on Windows).

2. Connect to the Virtual Instance in one of the following ways:

* To connect using an SSH key pair, run the following command:

```sh theme={null}
ssh -i ~/path/to/your/private-key username@public-ip-of-your-instance
```

For example: `ssh -i ~/.ssh/id_rsa ubuntu@185.188.146.129`

* To connect with a password (only if configured during instance creation), run the following command and enter the password when prompted:

```sh theme={null}
ssh username@192.168.1.92
```

<Tip>
  To find the instance username and public IP, in the Customer Portal navigate to **Cloud** > **Virtual Instances** and open the instance. The SSH credentials appear next to the **Access to Console** button in the format `[login]@[ip-of-your-instance]`.

  Typically, the login matches the OS name — for example, `ubuntu`.
</Tip>

3. When asked to add the device to the list of known devices, enter `yes` and press **Enter**.

4. The connection is established.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/linux-connected.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=3c42d9640deb53974e2089fe11d9e4f5" alt="Ubuntu terminal displaying successful SSH connection" width="2576" height="1644" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/linux-connected.png" />
</Frame>

## Connect with PuTTY

Follow these instructions to connect to a Virtual Instance from Windows 10/11 devices:

1. Run the [PuTTY app](https://putty.org/).

2. Open the **Session** section and enter the instance IP address in the **HostName (or IP address)** field.

3. Confirm that port 22 is set in the **Port** field. This is the standard port for SSH connections.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/puttygen-session.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=333b12acbde94c0129cbb657d7b57a12" alt="PuTTY Session settings with Host Name and Port fields" width="1808" height="1800" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/puttygen-session.png" />
</Frame>

<Tip>
  To find the instance IP address, in the Customer Portal navigate to **Cloud** > **Virtual Instances**. The IP address appears in the **IP Address** column.
</Tip>

4. Confirm that the **Connection type** parameter is set to **SSH**.

5. From the sidebar, go to **Connection** > **SSH** > **Auth** > **Credentials**.

6. Select **Browse** and locate the private SSH key file.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/puttygen-session-annotated.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=3e2d2b597fabe716560d390bd6482985" alt="PuTTY Credentials tab with the Browse button for selecting a private key" width="2700" height="1776" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/puttygen-session-annotated.png" />
</Frame>

7. Load the private key file in `.ppk` format.

8. Select **Open** to launch the PuTTY terminal.

9. If connecting to the Virtual Instance for the first time, select **Accept** when prompted to cache the host key.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/putty-cache-server.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=3c5b53e487af6056cfd86a3580cb8faa" alt="PuTTY security alert asking to cache the server host key" width="2692" height="1632" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/putty-cache-server.png" />
</Frame>

10. Log in using the following credentials:

* **Login**: enter the username specified during instance creation.
* **Password** (optional): if a password was configured during instance creation, enter it.

<Tip>
  To find the instance username and public IP, in the Customer Portal navigate to **Cloud** > **Virtual Instances** and open the instance. The SSH credentials appear next to the **Access to Console** button in the format `[login]@[ip-of-your-instance]`.

  Typically, the login matches the OS name — for example, `ubuntu`.
</Tip>

11. Press **Enter**.

12. The connection is established.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/putty-connected.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=4b98535ac2379f3fa721a3fdb8508195" alt="PuTTY terminal displaying successful SSH connection" width="3240" height="2096" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/putty-connected.png" />
</Frame>

## Connect via OpenSSH

Windows has a built-in OpenSSH client that provides terminal access to a Virtual Instance, similar to Linux. The component is not activated by default. Follow these steps to activate it:

1. Open **Windows Settings**.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-settings.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=6c6009e40040ac39c02f6a9fdeacbb43" alt="Windows Settings home page" width="2456" height="1288" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-settings.png" />
</Frame>

2. Navigate to **Apps** and select **Optional features**.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-optional-features.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=f8b8763bfc2e63153328e277c9e0d03b" alt="Windows Apps and features page showing Optional features link" width="2100" height="1336" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-optional-features.png" />
</Frame>

3. Find **OpenSSH Client**, expand it, and select **Install**.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-openssh.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=557fb9e6abf511af1fcaf02c14f0e020" alt="Windows Optional features page with OpenSSH Client ready to install" width="2008" height="1632" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/windows-openssh.png" />
</Frame>

4. After the installation completes, restart the computer to apply the settings. The OpenSSH client becomes available from Command Prompt (`cmd.exe`).

5. Open **Command Prompt** and connect to the Virtual Instance in one of the following ways:

* To connect using an SSH key pair, run the following command:

```sh theme={null}
ssh -i ~/path/to/your/private-key username@public-ip-of-your-instance
```

* To connect with a password (only if configured during instance creation), run the following command and enter the password when prompted:

```sh theme={null}
ssh username@192.168.1.92
```

<Tip>
  To find the instance username and public IP, in the Customer Portal navigate to **Cloud** > **Virtual Instances** and open the instance. The SSH credentials appear next to the **Access to Console** button in the format `[login]@[ip-of-your-instance]`.

  Typically, the login matches the OS name — for example, `ubuntu`.
</Tip>

6. When asked to add the device to the list of known devices, enter `yes` and press **Enter**.

7. The connection is established.

<Frame>
  <img src="https://mintcdn.com/gcore/YEsPf7l6EvNuxMEL/images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/linux-connected.png?fit=max&auto=format&n=YEsPf7l6EvNuxMEL&q=85&s=3c42d9640deb53974e2089fe11d9e4f5" alt="Command Prompt displaying successful SSH connection" width="2576" height="1644" data-path="images/docs/cloud/virtual-instances/connect/establish-ssh-connection-to-an-instance/linux-connected.png" />
</Frame>
