Skip to main content
Create a new ssh-key

Usage

vastai create ssh-key [ssh_public_key] [-y]

Arguments

ssh_key
string
required
add your existing ssh public key to your account (from the .pub file). If no public key is provided, a new key pair will be generated.

Options

-y
boolean
automatically answer yes to prompts (alias: --yes)

Description

You may use this command to add an existing public key, or create a new ssh key pair and add that public key, to your Vast account. If you provide an ssh_public_key.pub argument, that public key will be added to your Vast account. All ssh public keys should be in OpenSSH format. Example: $vastai create ssh-key ‘ssh_public_key.pub’ If you don’t provide an ssh_public_key.pub argument, a new Ed25519 key pair will be generated. Example: $vastai create ssh-key The generated keys are saved as ~/.ssh/id_ed25519 (private) and ~/.ssh/id_ed25519.pub (public). Any existing id_ed25519 keys are backed up as .backup_<timestamp>. The public key will be added to your Vast account. All ssh public keys are stored in your Vast account and can be used to connect to instances they’ve been added to.

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)