# urbestack-user-second-factor-enrol

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-user-second-factor-enrol --name NAME
```

## Description

Starts enrolment of a TOTP second factor and prints the secret as text and as an otpauth:// URI for an authenticator app. The second factor stays pending until you supply a code from the app to urbestack-user-second-factor-confirm.

If the user already has a confirmed second factor, turn it off with urbestack-user-set --second-factor off before enrolling a new one.

## Same in the API

- [POST /auth/second-factor](https://urbestack.com/docs/api/post-auth-second-factor.md): Start enrolment of the caller's second factor

## Command family: user

- [urbestack-user-add](https://urbestack.com/docs/commands/urbestack-user-add.md): Creates an UrbeStack account.
- [urbestack-user-del](https://urbestack.com/docs/commands/urbestack-user-del.md): Deletes an UrbeStack account and its domains, subdomains, DNS zones, databases and database users.
- [urbestack-user-list](https://urbestack.com/docs/commands/urbestack-user-list.md): Lists UrbeStack accounts.
- [urbestack-user-second-factor-codes](https://urbestack.com/docs/commands/urbestack-user-second-factor-codes.md): Replaces the user's recovery codes with eight new codes and prints them once.
- [urbestack-user-second-factor-confirm](https://urbestack.com/docs/commands/urbestack-user-second-factor-confirm.md): Confirms a pending second factor using the authenticator app's six-digit code supplied with --code.
- [urbestack-user-set](https://urbestack.com/docs/commands/urbestack-user-set.md): Updates an existing UrbeStack account.
