AI Tools - Remote SSH Connection
Learn how to configure a remote SSH connection with AI Notebooks and AI Training
Objective
This tutorial covers the process of starting a job using a Visual Studio Code Remote via SSH.
Requirements
- An AI Notebook or AI Training Project created inside a Public Cloud project in your OVHcloud account
- An AI user
- The OVHcloud AI CLI installed on your computer
OVHcloud Console Access
- Direct link:
- Navigation path:
Public Cloud> Select your project >AI>AI Notebooks
Instructions
Installation
- Install an OpenSSH compatible SSH client if one is not already present.
- Install Visual Studio Code.
- Install the Remote Development extension pack.
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:
-t ed25519creates a modern, secure key (recommended).-Clets 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
Here is how to add your SSH key to your AI Solution if you are using the or the ovhai CLI:
In the left-hand menu of your Public Cloud project, click AI Notebooks or AI Training under AI.
From there, click Create a notebook or Create a job to configure and create your AI Solution.
Fill in the various details required until you reach the Advanced configuration section. Turn on the SSH key switch, then click Add an SSH key.
In the dialog that opens, select Existing key to choose one of your project keys, or New key to register a new one: enter a Name and paste the content of your public key file (e.g., id_ed25519.pub) in the Public key field. Then click Add.
The number of configured keys is displayed below the list (for example 1 / 10 keys).
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.
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
Before continuing, you can verify you can access your job by running the following command from a terminal / PowerShell window, replacing <job-id> with the ID of your job and <region> with your resource location (e.g., gra, bhs):
If the SSH key is well configured, you should see the following:
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:
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.
For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.
Feedback
Please send us your questions, feedback and suggestions to improve the service:
- On the OVHcloud Discord server