Sub topic 6
Turning on MFA for the root user
This chapter assumes you have created the account and can sign in as the root user. It also assumes you know what a password and a one-time code are, and that you can run AWS CLI commands. You will register a multi-factor authentication (MFA) device on the root user, register a second one as a backup, and verify the result from the CLI.
Why root MFA comes first
The root user can close the account, change the support plan, and edit every resource. A leaked password with no second factor gives an attacker all of that. MFA adds a second proof at sign-in: something you have (a device or a passkey) on top of something you know (the password).
AWS now requires MFA for root users. The requirement started with Organizations management accounts and was extended to standalone accounts. Even if the console does not force you today, treat MFA as mandatory.
What happens at sign-in
After you enter the root email and password, AWS asks for the second factor. The factor can be a code, a tap on a security key, or a biometric check for a passkey.
Choosing the factor in the console
The spine's earlier chapter compared factor types. In short, AWS offers three families for the root user.
| Factor | How it works | Strength | Main risk |
|---|---|---|---|
| Passkey or security key (FIDO2) | The device signs a challenge that is bound to the AWS sign-in domain | Resists phishing, because a fake site cannot get a valid response | A passkey stored in only one place can be lost with that place |
| Authenticator app (virtual TOTP) | An app shows a 6-digit code that changes every 30 seconds | Free and easy to set up | A code can be typed into a phishing page, and the secret lives on a phone |
| Hardware TOTP token | A small dedicated device shows the 6-digit code | No phone needed | Costs money, has a battery, and one token is tied to one account |
SMS text-message MFA is not offered for AWS accounts. A FIDO2 security key or passkey is the strongest choice for the root user.
Step-by-step: register the first device
- Open the AWS sign-in page and choose Root user. Enter the root email address, then the password.
- Choose your account name in the top right corner, then Security credentials.
- Find the Multi-factor authentication (MFA) section and choose Assign MFA device.
- Enter a Device name. Use something that tells you where the factor lives, such as
root-yubikey-safeorroot-authenticator-phone. - Pick the device type: Passkey or security key, Authenticator app, or Hardware TOTP token.
- Finish the type-specific step:
- Passkey or security key: choose Next, then follow the browser prompt. Touch the key, or approve with your fingerprint, face, or device PIN.
- Authenticator app: choose Next, then scan the QR code with the app. Enter two consecutive codes, waiting for the code to change between them. Then choose Add MFA.
- Hardware TOTP token: enter the token's serial number, then two consecutive codes.
- Confirm that the device now appears in the list with its type and creation time.
The two consecutive codes prove that your device and AWS agree on the shared secret and the current time. This is the step that most often fails, as the next section explains.
Register a second device
A root user can have up to eight MFA devices. Register at least two, and keep them in different places.
- A security key in a safe or locked drawer, and a passkey in a password manager you trust.
- Or an authenticator app on your phone, and a hardware security key off-site.
Repeat the registration steps with a different device name. Test each device in a fresh private browser window: sign out, sign in as root, and complete MFA with each device in turn. A backup you have never used is a guess, not a backup.
If you lose every device, you can still recover. On the MFA prompt, choose the troubleshooting link and prove control of the root email address and the phone number on the account. This is why the earlier chapter stressed protecting the root email and keeping the contact details current. Recovery is only as strong as those two channels.
Verify with the CLI
Run the next commands with your daily admin identity, not root credentials. The identity needs permission to call iam:GetAccountSummary, iam:GenerateCredentialReport, and iam:GetCredentialReport.
First confirm which identity the CLI is using:
aws sts get-caller-identityThe Arn in the output should end in a user or role name, not :root. If you see :root, stop. You are using root access keys, which a later chapter tells you to delete.
Then check the account summary:
aws iam get-account-summary \
--query 'SummaryMap.{RootMFA:AccountMFAEnabled,RootAccessKeys:AccountAccessKeysPresent}'A healthy result looks like this:
{
"RootMFA": 1,
"RootAccessKeys": 0
}RootMFA is 1 when the root user has at least one MFA device. It is 0 when none is registered. The summary does not tell you how many devices exist, or which types.
For a second opinion, generate the credential report and read the root row:
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 --decodeThe report is a CSV with one row per user. The root user's row is labelled <root_account>. The mfa_active column should say true. If generate-credential-report reports State: STARTED, wait a few seconds and run the second command again.
To print only the root row's MFA value, use column 8:
aws iam get-credential-report --query Content --output text \
| base64 --decode \
| awk -F, '$1 == "<root_account>" { print "mfa_active=" $8 }'Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| "Invalid MFA code" during registration | Phone or computer clock is off, or you entered the same code twice | Turn on automatic time sync, wait for the code to change, and enter two different consecutive codes |
| Registered, but `AccountMFAEnabled` is still `0` | You added MFA while signed in as an IAM user, which protects that user only | Sign out, sign in as **Root user**, and register MFA under the root account's security credentials |
| Passkey prompt never appears | Browser or operating system does not support it, or a pop-up blocker interfered | Try a current browser, allow the prompt, or use a security key |
| Cannot sign in after changing phones | The authenticator secret was not transferred | Use your backup device, or run the MFA recovery with email and phone verification |
| Only one device registered, and it is lost | No backup was added | Recover through email and phone, then register two devices |
| Console prompts for MFA, but CLI calls still work with an old key | MFA at sign-in does not protect long-term access keys | Delete root access keys, as covered in the next chapter on keys |
Edge cases worth knowing
- Shared team access. Do not give the whole team a single root authenticator app. Store the root factors with the small group that needs them, and log each use.
- Same phone for everything. If the phone holds your email, your password manager, and your authenticator, one theft can open all three. Keep the root factor on a separate device when you can.
- Passkey sync. A passkey synced through your password manager is as safe as that manager's own login. Protect that login with its own MFA.
- Changing a device. To replace a device, register the new one first, test it, and only then remove the old one.
Exercise
You registered an authenticator app while signed in with your IAM admin user. aws iam get-account-summary still shows AccountMFAEnabled as 0. Why, and what do you do?
Show answer
MFA registered under an IAM user protects only that IAM user, so the root user still has no device. Sign out, sign in with the root email and password through the Root user sign-in option, open Security credentials from the account menu, and assign an MFA device there. Then register a second device as a backup and run the CLI check again, which should show 1.
Exercise
A teammate says one authenticator app on their phone is enough for the root user because the phone is always with them. Name two risks and a fix.
Show answer
If the phone is lost, stolen, reset, or replaced without moving the secret, the root user loses its only factor and recovery depends on email and phone verification. A single phone can also hold the email, password manager, and authenticator, so one theft exposes all of them. The fix is to register a second device in a different location, such as a hardware security key in a safe, and to test both devices.