SSH access to your GPU
You can log in to a rented GPU with your own SSH key and run your own code on it. You add the public key once. Every GPU you deploy with that key then accepts your login.
- Add your public key once on the SSH Keys page, or generate a keypair there
- Select the key when you deploy a GPU
- Copy the SSH command from the instance card when the GPU is running
- Stop the instance when you are done. Billing runs until you stop it
1. Get an SSH key
If you already have a key (for example ~/.ssh/id_ed25519.pub), skip to step 2.
Create a new key on your computer:
ssh-keygen -t ed25519 -C "my-laptop"
This writes two files:
| File | What it is |
|---|---|
~/.ssh/id_ed25519 |
Your private key. Keep it on your computer. Never paste it anywhere. |
~/.ssh/id_ed25519.pub |
Your public key. This is the one you add to AIVory. |
On Windows, use the OpenSSH client that ships with Windows (ssh-keygen and ssh in PowerShell). The key goes to C:\Users\<you>\.ssh\.
Show the public key so you can copy it:
cat ~/.ssh/id_ed25519.pub
It is one line that starts with ssh-ed25519 (or ssh-rsa, ecdsa-sha2-...).
2. Add the key to AIVory
- Open SSH Keys in the dashboard (Smart Inference > SSH Keys).
- Click Add SSH Key.
- Enter a name, for example
my-laptop. - Paste the public key line and save.
Keys belong to your organization, so your team members can use them too.
Default keys. Mark a key as default and it is preselected on every new deployment.
Generate a keypair instead. Choose Generate keypair in the same dialog. We create an ed25519 keypair and show the private key once. We never store it. Save it to a file, then restrict the file:
# macOS / Linux
chmod 600 ~/.ssh/aivory_key
# Windows (PowerShell)
icacls $HOME\.ssh\aivory_key /inheritance:r /grant:r "$($env:USERNAME):R"
3. Deploy a GPU with your key
- Open GPU Instances and pick an offer.
- In the deploy dialog, select your key(s) in SSH Keys. Default keys are already selected.
- For a plain machine to run your own code, leave the Model field empty and keep the default image.
- Deploy.
The hint under SSH Keys tells you when SSH is not possible for the selected offer. In that case the selector is greyed out. Pick a different offer.
Model deployments. On some offers SSH works only on a plain machine, not together with a model deployment. The hint tells you when this applies.
Custom images. On some offers your workload runs inside a container. A custom image must then start an SSH server itself. If you are not sure, keep the default image. It starts an SSH server for you.
4. Log in
Wait until the instance shows Running. The instance card then shows a Connect box with the exact SSH command, including user, host and port. Copy it and add your private key with -i:
ssh -i ~/.ssh/id_ed25519 [email protected] -p 22
The user name depends on the machine (root, ubuntu or aivory). Always use the one in the Connect box.
Check the GPU:
nvidia-smi
5. Copy files and run your code
Copy files with scp (note the capital -P for the port):
scp -i ~/.ssh/id_ed25519 -P 22 train.py requirements.txt [email protected]:~/
Or clone your repository on the machine:
git clone https://github.com/you/your-project.git
cd your-project
pip install -r requirements.txt
Start long jobs inside tmux (or screen). The job then keeps running when your SSH connection drops:
tmux new -s job
python train.py
# detach: Ctrl+B, then D. Reattach later: tmux attach -t job
To reach a web UI on the machine (Jupyter, TensorBoard), forward the port through SSH:
ssh -i ~/.ssh/id_ed25519 -p 22 -L 8888:localhost:8888 [email protected]
# then open http://localhost:8888 on your computer
6. Stop the instance
Click Stop Instance on the instance card when you are done. You pay for the time the GPU runs, not for the time you are logged in. See GPU billing.
Troubleshooting
| Problem | Cause and fix |
|---|---|
Permission denied (publickey) |
The key on your computer does not match a key selected at deploy time. Check the -i path. Compare fingerprints with ssh-keygen -lf ~/.ssh/id_ed25519.pub and the SSH Keys page. A key added after deployment needs a new deployment. |
Connection refused or timeout |
The SSH server is still starting. Wait one or two minutes after Running and try again. With a custom image, check that the image starts an SSH server. |
| No SSH command in the Connect box | The instance was deployed without a key, or the offer has no SSH. Deploy again with a key selected and the Model field empty. |
| Asked for a passphrase every time | Your key has a passphrase. Load it once into the agent: ssh-add ~/.ssh/id_ed25519. On Windows, start the ssh-agent service first. |
UNPROTECTED PRIVATE KEY FILE |
The private key file is readable by others. Run the chmod 600 or icacls command from step 2. |
Still stuck? Write to [email protected] with the instance ID. We help you set it up.
Using the API
Pass your public keys in ssh_public_keys when you rent:
curl https://smart.aivory.net/v1/gpu/rent \
-H "Authorization: Bearer $SI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpu_model": "A40",
"ssh_public_keys": ["ssh-ed25519 AAAA... my-laptop"]
}'
Poll GET /v1/gpu/rentals/{rental_id}. When status is running, the response has ssh_host, ssh_port and ssh_username. GET /v1/gpu/providers shows per provider whether SSH is supported (capabilities.ssh). See the GPU API reference.