Create an IAM user for emergency access - AWS Identity and Access Management

Create an IAM user for emergency access

An IAM user is an identity within your AWS account that has specific permissions for a single person or application.

Having an IAM user for emergency access is one of the recommended reasons to create an IAM user so that you can access your AWS account if your identity provider isn't accessible.

Note

As a security best practice, we recommend that you provide access to your resources through identity federation instead of creating IAM users. For information about specific situations where an IAM user is required, see When to create an IAM user (instead of a role).

To create an IAM user for emergency access

Choose the tab for the method you want to follow to create the IAM user :

Minimum permissions

To perform the following steps, you must have at least the following IAM permissions:

  • access-analyzer:ValidatePolicy

  • iam:AddUserToGroup

  • iam:AttachGroupPolicy

  • iam:CreateGroup

  • iam:CreateLoginProfile

  • iam:CreateUser

  • iam:GetAccountPasswordPolicy

  • iam:GetLoginProfile

  • iam:GetUser

  • iam:ListAttachedGroupPolicies

  • iam:ListAttachedUserPolicies

  • iam:ListGroupPolicies

  • iam:ListGroups

  • iam:ListGroupsForUser

  • iam:ListPolicies

  • iam:ListUserPolicies

  • iam:ListUsers

IAM console
  1. Follow the sign-in procedure appropriate to your user type as described in the topic How to sign in to AWS in the AWS Sign-In User Guide.

  2. On the Console Home page, select the IAM service.

  3. In the navigation pane, select Users and then select Create user.

    Note

    If you have IAM Identity Center enabled, the AWS Management Console displays a reminder that it's best to manage users' access in IAM Identity Center. In this procedure, the IAM user you create is specifically for use only when your identity provider is unavailable.

  4. On the Specify user details page, under User details, in User name, enter the name for the new user. This is their sign-in name for AWS. For this example, enter EmergencyAccess.

    Note

    User names can be a combination of up to 64 letters, digits, and these characters: plus (+), equal (=), comma (,), period (.), at sign (@), underscore (_), and hyphen (-). Names must be unique within an account. They are not distinguished by case. For example, you cannot create two users named TESTUSER and testuser. When a user name is used in a policy or as part of an ARN, the name is case sensitive. When a user name appears to customers in the console, such as during the sign-in process, the user name is case insensitive.

  5. Choose the checkbox next to Provide user access to the AWS Management Console– optional and then choose I want to create an IAM user.

  6. Under Console password, select Autogenerated password.

  7. Clear the checkbox next to User must create a new password at next sign-in (recommended). Because this IAM user is for emergency access, a trusted administrator retains the password and only provides it when needed.

  8. On the Set permissions page, under Permissions options, select Add user to group. Then, under User groups, select Create group.

  9. On the Create user group page, in User group name, enter EmergencyAccessGroup. Then, under Permissions policies, select AdministratorAccess.

  10. Choose Create user group to return to the Set permissions page.

  11. Under User groups, select the name of the EmergencyAccessGroup you created previously.

  12. Choose Next to proceed to the Review and create page.

  13. On the Review and create page, review the list of user group memberships to be added to the new user. When you are ready to proceed, select Create user.

  14. On the Retrieve password page, select Download .csv file to save a .csv file with the user credential information (Connection URL, username, and password).

  15. Save this file to use if you need to sign-in to IAM and don't have access to your identity provider.

The new IAM user is displayed in the Users list. Select the User name link to view the user details.

AWS CLI
  1. Create a user named EmergencyAccess.

    aws iam create-user \ --user-name EmergencyAccess
  2. (Optional) Give the user access to the AWS Management Console. This requires a password. To create a password for an IAM user you can use the --cli-input-json parameter to pass a JSON file that contains the password.You must also give the user the URL of your account's sign-in page.

    • aws iam create-login-profile

      aws iam create-login-profile \ --generate-cli-skeleton > create-login-profile.json
    • Open the create-login-profile.json file in a text editor and enter a password that complies with your password policy, then save the file. For example:

      { "UserName": "EmergencyAccess", "Password": "Ex@3dRA0djs", "PasswordResetRequired": false }
    • Use the aws iam create-login-profile command again, passing the --cli-input-json parameter to specify your JSON file.

      aws iam create-login-profile \ --cli-input-json file://create-login-profile.json
    Note

    If the password you provided in the JSON file violates your account's password policy, you will receive a PassworPolicyViolation error. If this happens, review the password policy for your account and update the password in the JSON file to comply with the requirements.

  3. Create the EmergencyAccessGroup, attach the AWS managed policy AdministratorAccess to the group, and add the EmergencyAccess user to the group.

    Note

    An AWS managed policy is a standalone policy that is created and administered by AWS. Each policy has its own Amazon Resource Name (ARN) that includes the policy name. For example, arn:aws:iam::aws:policy/IAMReadOnlyAccess is an AWS managed policy. For more information about ARNs, see IAM ARNs. For a list of AWS managed policies for AWS services, see AWS managed policies.

    • aws iam create-group

      aws iam create-group \ --group-name EmergencyAccessGroup
    • aws iam attach-group-policy

      aws iam attach-group-policy \ --policy-arn arn:aws:iam::aws:policy/AdministratorAccess \ --group-name >EmergencyAccessGroup
    • aws iam add-user-to-group

      aws iam add-user-to-group \ --user-name EmergencyAccess \ --group-name EmergencyAccessGroup
    • Run the aws iam get-group command to list theEmergencyAccessGroup and its members.

      aws iam get-group \ --group-name EmergencyAccessGroup