Skip to main content
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

vastai attach "ssh 12371 ssh-rsa AAAAB3NzaC1yc2EAAA..."
 vastai attach "ssh 12371 ssh-rsa $(cat ~/.ssh/id_rsa)"

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)