Skip to main content
Authorize your account to add a new 2FA method

Usage

vastai tfa auth-new {[--method-type METHOD_TYPE | --method-id ID | --backup-code BACKUP_CODE] | [--secret SECRET --code CODE]}

Options

--code
string
2FA code from Authenticator app, SMS, or Email
--secret
string
Secret token from previous auth step
--method-type
string
default:"email"
2FA Method type. Only use when you only have one method of this type Allowed values: email, sms, totp
--backup-code
string
One-time backup code (alternative to regular 2FA code)
--method-id
string
2FA Method ID if you have more than one of the same type (‘id’ from tfa status)

Description

Authorize your account to add a new 2FA method by verifying via email or an existing method. This is a required step to ensure that only you can add new 2FA methods to your account. Step 1. Run command with your chosen verification method:
  • If you have an existing 2FA method set up, you can use ‘—backup-code BACKUP_CODE’ to immediately authorize (skip Step 2)
  • Use —method-type or —method-id ID to specify which existing method to use for verification (see vastai tfa status for available methods and their IDs)
  • Use —method-type email if you have a verified email address and/or no other 2FA methods set up to receive a code via email
Step 2. When prompted, enter the 2FA code from your 2FA method of choice to confirm authorization. Note: If you exit the command before being able to enter the code, you can run this command again with —secret SECRET and —code CODE to complete the authorization step as long as the code has not expired.

Examples

# Initiating New Method Authorization
 vastai tfa auth-new  (method type is email by default)
 vastai tfa auth-new --method-type totp
 vastai tfa auth-new -t sms
 vastai tfa auth-new --method-id 456
 vastai tfa auth-new --backup-code ABCD-EFGH-IJKL

 # Completing Authorization with code and secret if not completed in previous run
 vastai tfa auth-new --secret abc123def456 --code 123456

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)