You’ve successfully created your first AWS IAM user, a crucial step in securing your cloud environment. But what’s the next layer of defense? In the world of digital security, a password is no longer enough. The single most effective action you can take to protect your account from unauthorized access is to enable AWS MFA, or Multi-Factor Authentication.
This comprehensive guide will explain everything you need to know. We’ll cover what MFA is, why it’s non-negotiable for account security, and walk you through the entire process of setting it up for your IAM user using a virtual MFA device on your smartphone.
How to Enable AWS MFA (Quick Answer)
For those looking for a quick summary, here’s how to enable AWS Multi-Factor Authentication:
- Log in to the AWS Management Console as your IAM user.
- Navigate to the IAM service dashboard.
- Go to Users and select your username.
- Click on the “Security credentials” tab.
- In the “Multi-factor authentication (MFA)” section, click “Manage”.
- Select “Virtual MFA device” and follow the on-screen instructions to scan the QR code with an authenticator app (like Google Authenticator) and enter two consecutive MFA codes.
What is Multi-Factor Authentication (MFA)?
Multi-Factor Authentication (MFA) is a security system that requires more than one method of authentication to verify a user’s identity. Instead of just asking for something you know (your password), it also asks for something you have (like your phone) or something you are (like your fingerprint).
Think of it like the security for a bank vault. You need a key (something you have) and a combination code (something you know) to open the door. Having just one isn’t enough. By requiring a second factor, MFA makes it exponentially more difficult for an attacker to gain access to your account, even if they manage to steal your password.
Why is AWS MFA Absolutely Essential?
In today’s security landscape, passwords are a fundamentally weak link. They can be stolen through phishing attacks, guessed by brute-force methods, or exposed in data breaches. Relying on a password alone is like leaving your front door unlocked.
Enabling AWS MFA provides a critical layer of protection for your cloud resources. When you log in, after entering your correct username and password, AWS will prompt you for a temporary, time-sensitive, six-digit code from your MFA device.
This means that even if an attacker steals your password, they cannot log in to your account because they do not have physical access to your phone or hardware key. For a resource as powerful and important as your AWS account, this second layer of security is not just a recommendation—it is an industry-standard best practice.
Choosing Your MFA Device
AWS supports several types of MFA devices, but for most users, the most common and convenient choice is a virtual MFA device.
Virtual MFA Devices (Recommended)
This is the method we will use in this tutorial. A virtual MFA device is simply an application you install on your smartphone that generates time-based, six-digit codes. They are free, easy to set up, and highly secure.
- Popular Authenticator Apps:
- Google Authenticator (Android/iOS)
- Microsoft Authenticator (Android/iOS)
- Authy (Desktop/Mobile)
FIDO Security Keys (Hardware Keys)
These are small hardware devices that plug into your computer’s USB port (like a YubiKey). They provide the highest level of security because they require a physical touch to authenticate. They are an excellent choice for highly sensitive accounts but do require a hardware purchase.
Step-by-Step Guide to Enable AWS MFA on Your IAM User
Let’s walk through the process of setting up a virtual MFA device for the IAM user you created in our previous tutorial.
Step 1: Log in as Your IAM User
First, it’s important that you log out of your root user account and log back in using the special sign-in URL for your IAM users.
- Find the Console sign-in URL you saved when you created your IAM user. It will look something like
https://123456789012.signin.aws.amazon.com/console
. - Log in with the IAM username and password you created.
Step 2: Navigate to Your Security Credentials
Once you are logged in as your IAM user, you need to find your personal security settings.
- In the top-right corner of the AWS Management Console, click on your username.
- From the dropdown menu, select “Security credentials”.

Step 3: Manage MFA Assignment
This will take you to the IAM dashboard, scoped directly to your own user.
- You will see a summary box for “Multi-factor authentication (MFA)”.
- Click the “Manage” button on the right side of this box.
Step 4: Configure the Virtual MFA Device
Now we will begin the setup wizard.
- A “Manage MFA device” window will appear. Ensure “Virtual MFA device” is selected.
- Click “Continue”.
Step 5: Link Your Authenticator App
This is the most important part of the process, where you will link your smartphone app to your AWS account.
- AWS will now display a QR code on the screen. Click “Show QR code”.
- Open your chosen authenticator app on your smartphone (e.g., Google Authenticator).
- Tap the “+” button to add a new account and select “Scan a QR code.”
- Point your phone’s camera at the QR code on your computer screen.
- Your app will instantly recognize the QR code and add a new entry for your AWS account, which will immediately start generating six-digit codes that refresh every 30 seconds.

Step 6: Enter Two Consecutive MFA Codes
To confirm that your device is correctly synced, AWS requires you to enter two consecutive codes.
- Look at the six-digit code currently displayed in your authenticator app. Type it into the “MFA code 1” field.
- Wait for the code on your phone to expire and for a new one to appear (this usually takes 30 seconds).
- Type the new six-digit code into the “MFA code 2” field.
- Click the “Assign MFA” button.
You should see a green success message stating that you have successfully assigned the virtual MFA device.
Logging in With MFA
The next time you log in to your AWS account with your IAM user, the process will be slightly different:
- You will enter your username and password as usual.
- You will then be presented with a new screen asking for your “MFA code”.
- Open your authenticator app, look at the current code for your AWS account, and type it into the field.
- Click “Submit”.
You will now be securely logged in.
Read the next topic: What is an IAM Role? The Ultimate Guide to AWS Permissions
FAQ: AWS MFA
1. What happens if I lose my phone with the authenticator app?
Losing your MFA device can lock you out of your account. This is why it is critical for the root user of the account to have MFA enabled as well but to also have a plan for recovery. As an IAM user, if you lose your device, the root user or another administrator with the correct permissions must log in and deactivate the MFA device from your user profile so you can set it up again.
2. Can I use SMS text messages for MFA?
While some services use SMS for two-factor authentication, AWS does not recommend it and does not support it for the primary login. SMS is considered less secure due to risks like SIM swapping. Virtual MFA devices are the standard.
3. Is MFA really necessary for a personal account?
Yes, absolutely. Even personal accounts can have valuable resources or be used to cause significant damage if compromised. An attacker who gains access could launch expensive servers, resulting in a massive bill. Enabling MFA is the single most effective step you can take to prevent this.