Sub topic 6
Turning on MFA for the Root User
This chapter assumes you have created an AWS account and can sign in to the console as the root user. It also assumes you know what the root user is, which an earlier chapter covered. Here you will register a multi-factor authentication (MFA) device on the root user and confirm that it works.
Why MFA on root comes first
A password is one factor: something you know. MFA adds a second factor, something you have or are. If someone steals or guesses the root password, they still cannot sign in without the second factor. The root user has unrestricted power over the account, so it is the identity where this protection matters most.
Do this before you create any other resource. A new account with a password-only root user is the weakest point in your setup.
Choosing a factor
Your options were compared in the previous chapter. In short:
| Factor | Example | Notes |
|---|---|---|
| Passkey | Device biometrics, a password manager | Phishing resistant. Easy to sync across devices. |
| Security key | A FIDO2 hardware key | Phishing resistant. Keep a spare. |
| Authenticator app | A TOTP app on a phone | Widely available. Codes can be phished. |
AWS lets you register up to eight MFA devices on the root user. Use that to add a second device as a backup.
Registering the device
- Sign in to the AWS Management Console as the root user. Choose Root user and enter the root email address and password.
- Open the account menu in the top right corner and choose Security credentials.
- In the Multi-factor authentication (MFA) section, choose Assign MFA device.
- Enter a device name, such as
root-yubikey-1. Pick a name that tells you which physical device it is. - Select the device type: passkey or security key, or authenticator app.
- Follow the prompts. For a passkey or security key, you approve the browser request and touch the key. For an authenticator app, scan the QR code, then enter two consecutive codes.
- Choose Add MFA.
The two consecutive codes prove that the app's clock and secret match what AWS expects. Wait for the first code to change before you type the second one.
Add a backup device
Losing your only MFA device can lock you out of the account. Register a second device now, ideally of a different kind. For example, pair a hardware key kept in a safe with a passkey in your password manager. Store the backup in a different physical location from the first.
If you do lose every device, AWS offers account recovery using your root email and phone number. That process is slow. This is another reason to keep the root email and contacts protected and current.
Common errors
- The authenticator code is rejected. The phone clock is usually out of sync. Turn on automatic time in the phone settings and try two fresh codes.
- The browser does not offer your security key. Try another browser or USB port. Make sure the browser has permission to use security keys.
- The QR code was scanned into the wrong app entry. Remove the entry, remove the pending device in the console, and start over.
- Only one device registered. This works until that device is lost. Add a second one.
Verifying
Sign out, then sign in as root again. AWS should ask for the MFA factor after the password. You can also check from the CLI, using credentials for an administrative identity, not root:
aws iam get-account-summary \
--query 'SummaryMap.{RootMFA:AccountMFAEnabled,RootAccessKeys:AccountAccessKeysPresent}'RootMFA should be 1. A value of 0 means MFA is not active.
Exercise
You registered an authenticator app as the only MFA device on the root user. Name the risk this creates and one step that fixes it.
Show answer
If the phone is lost or reset, you cannot pass the MFA prompt and may be locked out of the root user. Register a second MFA device, preferably of a different type such as a hardware security key, and store it separately from the phone.
Exercise
After enabling MFA, what value should AccountMFAEnabled show in the account summary, and what does it mean?
Show answer
It should be 1, which means the root user has an MFA device assigned. A 0 means root is still protected only by its password.