---
title: "AI Tools - Remote SSH Connection"
description: "This tutorial covers the process of starting a job using Visual Studio Code Remote via SSH."
url: https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-tools-remote-ssh-connection
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# AI Tools - Remote SSH Connection

This tutorial covers the process of starting a job using Visual Studio Code Remote via SSH.

 

## Requirements

- Access to the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/)
- An AI Notebook **or** AI Training project created inside a [Public Cloud project](https://us.ovhcloud.com/public-cloud/)
- An [AI user](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/manage-users-roles.md)
- The [OVHcloud AI CLI](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-install-client.md) installed on your computer

**Warning:**

**NOTE:** The deployed image needs to contain the `bash` binary and a glibc-based Linux (Ubuntu / Debian).

 

## Instructions

### Installation

1. Install an [OpenSSH-compatible SSH client](https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client) if one is not already present.
2. Install [Visual Studio Code](https://code.visualstudio.com/).
3. Install the [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack).

 

### Generate an SSH keypair

If you don’t already have an SSH key, you will need to create one. To do so, open a Terminal / PowerShell, and run the key generation command:

```bash
ssh-keygen -t ed25519 -C "your_email@example.com"
```

**Note:**

- `-t ed25519` creates a modern, secure key (recommended).
- `-C` lets you add a label (usually your email) to identify the key.

This will create a private key (e.g., `id_ed25519`, not to share) and a public key (e.g., `id_ed25519.pub`) in your `~/.ssh/` directory.

 

### Specify the SSH key during AI Notebook or AI Training job creation

#### Using the OVHcloud Control Panel

First, go to the `Public Cloud` section of the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/).
Select your Public Cloud project, then go to the `AI & Machine Learning` category in the left menu and choose `AI Notebooks` or `AI Training` section.
From there, click on the `+ Create a notebook` or `+ Launch a job` button to configure and create your AI Solution.

Fill in the various details required until you find the `Advanced configuration` section. Open it.

From there you will find a `SSH Public Keys` sub-section where you can add and configure new SSH keys by clicking on the `+ Configure an SSH Key` button:

This will open a window where you can put the content of your public key file (e.g., `id_ed25519.pub`):

Click on `Confirm`. Once your key is added, you can select it from your SSH Keys list:

Once selected, make sure to click on the _add_ `+` button to confirm the addition of your key. You should see the following message: `1 of 10 SSH key configured`.

#### Using ovhai CLI

To follow this part, make sure you have installed the [ovhai CLI](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-install-client.md) on your computer or on an instance.
When creating your AI resource using the `ovhai` CLI, specify the SSH public key using the `--ssh-public-keys` option, or `-s` shortcut:
```bash
ovhai job run <job_image> \
  --gpu <nb-gpus> \
  --ssh-public-keys ~/.ssh/id_ed25519.pub
```
 
```bash
ovhai job run --gpu <nb-gpus> -s ~/.ssh/id_ed25519.pub ovhcom/ai-training-tensorflow:2.3.0
```
Once the job is `Running`, you can see the `sshUrl` with _job get_:
```bash
ovhai job get <job-id>
```

Once your job is created, regardless of the method chosen, you will be able to copy your job id (e.g., `bfa1d77a-9746-4128-9974-f94139937927`), which will be needed in the following steps.

**Warning:**

**NOTE:** In order to work, the deployed image needs to contain the `bash` binary and a glibc-based Linux (Ubuntu / Debian).

 

### Verify you can connect to the SSH host

Verify you can connect to the SSH host by running the following command from a terminal / PowerShell window replacing `<job-id>` with the ID of your job:

```bash
ssh <job-id>@us-east-va.ai.cloud.ovh.us

Welcome to OVHcloud AI Training Jobs SSH
job-0d916855-1cd4-4b66-8803-b4782bc13902:~$
```

 

### Configure VSCode Remote Connection

In Visual Studio Code, click on the `Remote Explorer` icon.

From there, click the gear icon on the SSH feature to access the SSH configuration file for VSCode, typically located at `~/.ssh/config`, and open it.

Add the following section for your new host:

```
Host my_ai_training_job
HostName <region>.ai.cloud.ovh.us # Adapt to your resource location (gra, bhs)
User bfa1d77a-9746-4128-9974-f94139937927 # ID of your AI Training Job or AI Notebook
IdentityFile C:\Path\To\id_ed25519 # Path to your private key file (not .pub)
```

Save the `config` file. Then refresh remotes by clicking on this icon:

Your resource should now appear in the SSH menu on the left. Connect to it by clicking the arrow next to your resource. VSCode will restart to connect to your remote resource:

If the connection is well established, you should see this message in the bottom-left corner of VSCode:

 

### Develop and Run Your Code

Once connected, you can start developing and running your code in the default `/workspace` folder, by clicking on the `Open folder` blue button, and select `/workspace`.

You can also open a terminal and run commands from it. Enjoy!

 

## Go further

You can compare AI models based on resource consumption, accuracy, and training time. Refer to this [tutorial](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/ai-training-models-comparaison-wandb.md).

Browse all the [AI & Machine Learning guides](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/landing-page-ai-machine-learning.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [AI & Machine Learning](https://us.ovhcloud.com/public-cloud/ai-machine-learning/) on the OVHcloud US website.

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://us.ovhcloud.com/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.
