Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vast.ai/llms.txt

Use this file to discover all available pages before exploring further.

Attach an ssh key to an instance. This will allow you to connect to the instance with the ssh key

Usage

vastai attach ssh instance_id ssh_key

Arguments

instance_id
integer
required
id of instance to attach to
ssh_key
string
required
ssh key to attach to instance

Description

Attach an ssh key to an instance. This will allow you to connect to the instance with the ssh key.

Examples

vast attach ssh 12371 AAAAB3NzaC1yc2EAAA...
 vast attach ssh 12371 $(cat ~/.ssh/id_rsa.pub)
 vast attach ssh 12371 ~/.ssh/id_rsa.pub

All examples attaches the ssh key to instance 12371

Global Options

The following options are available for all commands:
OptionDescription
--url URLServer REST API URL
--retry NRetry limit
--rawOutput machine-readable JSON
--explainVerbose explanation of API calls
--api-key KEYAPI key (defaults to ~/.config/vastai/vast_api_key)