# Two-factor sign-in

Two-factor sign-in asks for a 6-digit code from an authenticator app after the password. Any such app works: Google Authenticator, Microsoft Authenticator, 1Password, Aegis and others.

## Switch it on

1. Open *Settings > Security* and start two-factor sign-in with your password.
2. Scan the QR code into the app, or type the key shown beside it.
3. Type a code from the app to confirm.
4. Keep the ten one-time codes shown. Each signs you in once when the phone is not at hand (*No phone at hand?* on the sign-in page).

Your other sessions are signed out when it is switched on. Each code from the app works once.

## Require it

An admin sets *Settings > Accounts > Two-factor sign-in: required of*:

| Option | Who must use it |
|---|---|
| admins | every admin |
| admins and operators | every admin and operator |
| everybody | every account |

An account under the rule that has not set it up signs in with its password and lands on one page, which sets it up. Until that is done it sees nothing else. Whoever makes the rule must have it switched on for their own account first.

## One-time codes

*Settings > Security* says how many codes are left, and makes ten new ones, which ends the old ones. A sign-in with a one-time code is marked as such in the activity log.

## Wrong codes

After five wrong codes, from wherever they came, the account's second step is refused for 30 seconds, doubling up to 15 minutes. Only somebody who has the password ever meets this.

## A lost phone

- An admin takes the second step off that account under *Settings > Accounts*. Under a rule that requires it, the next sign-in sets it up anew.
- If it was the only admin's phone, run this on the computer qKVM runs on:

```
qkvm --disable-2fa NAME
```

## Who it is not asked of

People signed in by an identity provider, or by a proxy in front of qKVM, use that provider's second step instead. See [Single sign-on](https://qkvm.com/docs/web/single-sign-on).

## Related

- [Accounts and roles](https://qkvm.com/docs/web/accounts)
- [Single sign-on](https://qkvm.com/docs/web/single-sign-on)
- [Command line](https://qkvm.com/docs/web/command-line)
- [How it is protected](https://qkvm.com/docs/web/how-it-is-protected)

[Full reference](https://github.com/qkvm/qkvm/blob/main/GUIDE.md#two-factor-sign-in)
