Last active
April 25, 2023 06:26
-
-
Save cageyv/f6efe5185213b47525782544b8ccef17 to your computer and use it in GitHub Desktop.
AWS CLI Create User with Full Admin rights (Not recommended, insecure way)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # NOTES: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_cliwpsapi | |
| #!/usr/bin/env bash | |
| # https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-user.html | |
| # Step 1: Create IAM User | |
| aws iam create-user --user-name temp_admin | |
| # https://docs.aws.amazon.com/cli/latest/reference/iam/create-login-profile.html | |
| # Step 2: Add Console Access to that user | |
| aws iam create-login-profile --user-name temp_admin --password MyTempPasswordReplaceMe1# | |
| # https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/attach-user-policy.html | |
| # Step 3: Attach AdministratorAccess policy | |
| aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --user-name temp_admin | |
| # Step 4: Don't forget to add MFA/2FA | |
| # How to: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment