Create Multi-Factor Authentication (MFA) for your AWS accounts
Tags: beginners, tutorials, security, aws
Published: 2022-07-21 15:48:00

### Add an extra layer of protection

In this [blog](https://dev.to/aws-builders/aws-cost-explorer-cost-anomaly-detection-report-identifed-an-unauthorized-amazon-sagemaker-canvas-user-3524) of the security series, I discussed how my AWS Root User account was hacked with an unauthorized user and remediation steps included implementing AWS for the Root account.

In the previous [blog](https://dev.to/aws-builders/how-to-create-an-aws-cloudtrail-workflow-for-your-aws-account-3949) steps were outlined to create a multi-region trail to monitor and report on user and API activity with AWS CloudTrail.

In this post, we will implement Multi-Factor Authentication (MFA) on the AWS IAM User account to add an extra layer of protection to your user name and password with an auto generated code using a virtual MFA application.

## Tutorial: Create MFA on your Admin IAM user account

Step 1: [Sign in](https://aws.amazon.com/console/) to the AWS Management Console.

![sign in management console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvxamzojjqczaaqzra49.jpg)

Step 2: Login with your AWS IAM User credentials.

![sign in to your](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upjrvvv0akhyhvodtac8.jpg)

Step 3: In the AWS Management Console navigate to the search bar and type 'IAM'.


![type IAM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6202q0ugozvh9enp62i.jpg)


Step 4: On the AWS IAM dashboard you will see a best practice recommendation to implement MFA.


![need to create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ep2wq6aybpxt9ebym4mo.jpg)

Step 5: Click **Add MFA** and then select **Assign MFA device**

![Add MFA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4n4kva817pgx3y1v19g.jpg)

Step 6: Click **Virtual MFA device**. 

![assign device](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teqd9byp4kfiy0vs065e.jpg)

Read more information from this [link](https://aws.amazon.com/iam/features/mfa/?audit=2019q1) to understand which type of MFA is suitable for your circumstance.


![read](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rdoaimfnt17n5lvc146.jpg)

![download](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldph67ebt7sufog06gbz.jpg)

Step 7: For Virtual MFA Application, download 'Twilio Authy' for 
 your iPhone or Android mobile device.

![Twilio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbexkbx0yk0c27vrgb53.jpg)

Step 8: Open the Twilio app and use the camera to scan the QR code on your computer screen.

Enter two 6-digit codes provided by the Twilio app in the section provided.

Step 9: You will receive a message from the pop-up window that MFA was successfully created.


![success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xzg67fh7el06zyovbzdk.jpg)

You may repeat all of the above steps 1-9 for any additional AWS accounts  e.g. Root Account used for emails.

Step 10: Double check that MFA is implemented on your AWS IAM User account, login to the AWS Management Console with your user name, followed by your password. And Presto! You will receive an additional layer of security with a MFA prompt as shown below.


![Ask for MFA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnhgb8uo98sqfn7tbmk8.jpg)

### Conclusion

The AWS IAM Dashboard provides best practice recommendations.
You can see that MFA has been implemented.

![IAM dashbaord](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/irolykule12wiwi777st.jpg)

![set up sone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k930b0qk288xu4an23i6.jpg)

Until the next lesson, happy learning! 😁

### Join us for AWS re:Inforce conference

Next week is AWS re:Inforce conference, 26-27 July 📆 

A learning conference on compliance, privacy and identity 🔐🛠️

• Register to watch the keynote & sessions streamed live online 📺 or join the AWS Community in person in Boston.

• Link: https://reinforce.awsevents.com


![Reinforce](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjrctympdeoqdzdir9zu.jpg)

### Resources

[Multi-Factor Authentication](https://aws.amazon.com/iam/features/mfa/?audit=2019q1)