# Turn on a second factor

With a second factor on, signing in to your page takes your owner token and a 6-digit code from
an authenticator app on your phone (Google Authenticator, 1Password, Authy or any TOTP app).

**In short:** All machines → Agents → Sign-in security → Turn on, add the key to the app, type its code. Keep
the eight recovery codes.

## Before you start

Scripts that use your owner token as `Authorization: Bearer` stop working once the factor is on:
give them an [agent token](https://docs.cmdop.ai/concepts/tokens.md) with the risk classes they need. Agents are not
affected.

## Steps

1. Open your page, choose All machines, then the Agents tab, then **Sign-in security**.
2. Press **Turn on**. On the phone, open the link; on a computer, type the key into the app.
3. Type the code the app shows and press **Turn on**. Every other browser is signed out.
4. Copy the eight recovery codes somewhere safe. Each signs in once without the phone; they are
   not shown again.

## Signing in

After the token, the page asks for the code. A recovery code works there too. Five wrong codes
lock sign-in for 15 minutes.

## Turning it off

On the same screen, type a code from the app or a recovery code and press **Turn off**. Lost the
phone and the codes: whoever runs your server turns it off there (`cmdop-server otp off`).

## Related

[Tokens](https://docs.cmdop.ai/concepts/tokens.md) · [Revoke an agent](https://docs.cmdop.ai/guides/access/revoke.md)
