Enabling a virtual multi-factor authentication (MFA) device (console) - AWS Identity and Access Management

Enabling a virtual multi-factor authentication (MFA) device (console)

You can use a phone or other device as a virtual multi-factor authentication (MFA) device. To do this, install a mobile app that is compliant with RFC 6238, a standards-based TOTP (time-based one-time password) algorithm. These apps generate a six-digit authentication code. Because they can run on unsecured mobile devices, virtual MFA might not provide the same level of security as FIDO security keys. We do recommend that you use a virtual MFA device while waiting for hardware purchase approval or while you wait for your hardware to arrive.

Most virtual MFA apps support creating multiple virtual devices, allowing you to use the same app for multiple AWS accounts or users. You can register up to eight MFA devices of any combination of the currently supported MFA types with your AWS account root user and IAM users. With multiple MFA devices, you only need one MFA device to sign in to the AWS Management Console or create a session through the AWS CLI as that user. We recommend that you register multiple MFA devices. For authenticator applications, we also recommend enabling the cloud backup or sync feature in those apps to help you avoid losing access to your account if you lose or break your device with the authenticator apps.

For a list of virtual MFA apps that you can use, see Multi-Factor Authentication. AWS requires a virtual MFA app that produces a six-digit OTP.

Permissions required

To manage virtual MFA devices for your IAM user, you must have the permissions from the following policy: AWS: Allows MFA-authenticated IAM users to manage their own MFA device on the Security credentials page.

Enable a virtual MFA device for an IAM user (console)

You can use IAM in the AWS Management Console to enable and manage a virtual MFA device for an IAM user in your account. You can attach tags to your IAM resources, including virtual MFA devices, to identify, organize, and control access to them. You can tag virtual MFA devices only when you use the AWS CLI or AWS API. To enable and manage an MFA device using the AWS CLI or AWS API, see Enabling and managing virtual MFA devices (AWS CLI or AWS API). For more information about tagging IAM resources, see Tagging IAM resources.

Note

You must have physical access to the hardware that will host the user's virtual MFA device in order to configure MFA. For example, you might configure MFA for a user who will use a virtual MFA device running on a smartphone. In that case, you must have the smartphone available in order to finish the wizard. Because of this, you might want to let users configure and manage their own virtual MFA devices. In that case, you must grant users the permissions to perform the necessary IAM actions. For more information and for an example of an IAM policy that grants these permissions, see the IAM tutorial: Permit users to manage their credentials and MFA settings and example policy AWS: Allows MFA-authenticated IAM users to manage their own MFA device on the Security credentials page.

To enable a virtual MFA device for an IAM user (console)
  1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.

  2. In the navigation pane, choose Users.

  3. In the Users list, choose the name of the IAM user.

  4. Choose the Security Credentials tab. Under Multi-factor authentication (MFA), choose Assign MFA device.

  5. In the wizard, type a Device name, choose Authenticator app, and then choose Next.

    IAM generates and displays configuration information for the virtual MFA device, including a QR code graphic. The graphic is a representation of the "secret configuration key" that is available for manual entry on devices that do not support QR codes.

  6. Open your virtual MFA app. For a list of apps that you can use for hosting virtual MFA devices, see Multi-Factor Authentication.

    If the virtual MFA app supports multiple virtual MFA devices or accounts, choose the option to create a new virtual MFA device or account.

  7. Determine whether the MFA app supports QR codes, and then do one of the following:

    • From the wizard, choose Show QR code, and then use the app to scan the QR code. For example, you might choose the camera icon or choose an option similar to Scan code, and then use the device's camera to scan the code.

    • From the wizard, choose Show secret key, and then type the secret key into your MFA app.

    When you are finished, the virtual MFA device starts generating one-time passwords.

  8. On the Set up device page, in the MFA code 1 box, type the one-time password that currently appears in the virtual MFA device. Wait up to 30 seconds for the device to generate a new one-time password. Then type the second one-time password into the MFA code 2 box. Choose Add MFA.

    Important

    Submit your request immediately after generating the codes. If you generate the codes and then wait too long to submit the request, the MFA device successfully associates with the user but the MFA device is out of sync. This happens because time-based one-time passwords (TOTP) expire after a short period of time. If this happens, you can resync the device.

The virtual MFA device is now ready for use with AWS. For information about using MFA with the AWS Management Console, see Using MFA devices with your IAM sign-in page.

Replace a virtual MFA device

You can register up to eight MFA devices of any combination of the currently supported MFA types with your AWS account root user and IAM users. If the user loses a device or needs to replace it for any reason, you must first deactivate the old device. Then you can add the new device for the user.