Skip to main content
Regenerate backup codes for 2FA

Usage

vastai tfa regen-codes [--code CODE] [--sms] [--secret SECRET] [--backup-code BACKUP_CODE] [--method-id ID]

Options

-c
string
2FA code from Authenticator app (default) or SMS (alias: --code)
--sms
boolean
Use SMS 2FA method instead of TOTP
-s
string
Secret token from previous login step (required for SMS) (alias: --secret)
-bc
string
One-time backup code (alternative to regular 2FA code) (alias: --backup-code)
-id
string
2FA Method ID if you have more than one of the same type (‘id’ from tfa status) (alias: --method-id)

Description

Generate a new set of backup codes for your account. This action requires 2FA verification to prevent unauthorized regeneration. WARNING: This will invalidate all existing backup codes! Any previously generated codes will no longer work. Backup codes are one-time use codes that allow you to log in if you lose access to your primary 2FA method (lost phone, etc). You should regenerate your backup codes if: • You’ve used several codes and are running low • You think your codes may have been compromised • You lost your saved codes and need new ones Important: Save the new codes in a secure location immediately! They will not be shown again.

Examples

vastai tfa regen-codes --code 123456
 vastai tfa regen-codes -c 123456 --sms --secret abc123def456
 vastai tfa regen-codes --backup-code ABCD-EFGH-IJKL

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)