Creating IAM Users & Enabling MFA
Secure your AWS environment by moving away from the Root user. This guide provides a practical walkthrough for creating IAM users and enforcing Multi-Factor Authentication (MFA).
🏗️ Step 1: Create an Admin IAM User
- Log in to the AWS Management Console (opens in a new tab) as the Root User.
- Search for IAM in the top search bar.
- In the sidebar, click Users and then click Create user.
- User details:
- User name: e.g.,
admin-jane. - Select Provide user access to the AWS Management Console.
- User name: e.g.,
- Console access:
- Select I want to create an IAM user.
- Set a Custom password.
- Recommended: Check "User must create a new password at next sign-in".
- Set permissions:
- Select Add user to group.
- Create a group named
Adminsand attach the AdministratorAccess policy to it.
- Review and create: Click Create user.
🔐 Step 2: Enable Multi-Factor Authentication (MFA)
MFA is the most critical security setting for your account. It requires a code from your phone or a hardware key to log in.
- In the IAM dashboard, click on your username in the top-right and select Security credentials.
- Scroll to the Multi-factor authentication (MFA) section and click Assign MFA device.
- MFA device name: e.g.,
JanesPhone. - Select MFA device type:
- Authenticator app: (Recommended) Use Google Authenticator or Authy.
- Security Key: e.g., YubiKey.
- Set up device:
- Scan the QR code with your app.
- Enter two consecutive codes from your app into the boxes.
- Click Add MFA.
🚀 Step 3: Secure Your Login Portal
Instead of using a 12-digit Account ID, you can create a customized "Alias" for your login page.
- Go to the IAM Dashboard.
- On the right side, under AWS Account, look for Account Alias.
- Click Create and enter a unique name (e.g.,
my-devops-lab). - Your new login URL will be:
https://my-devops-lab.signin.aws.amazon.com/console.
✅ Step 4: The Final Handover
- Log out of the Root User account.
- Log in using your new IAM User at your custom login URL.
- Verification: Ensure you can access services and see the "IAM" dashboard.
- Conclusion: Now, lock your Root User credentials in a safe place and only use them for billing or account-level changes.
[!IMPORTANT] Checklist for Production
- Root user password is long and complex.
- MFA is enabled for Root.
- MFA is enabled for your Admin IAM user.
- No active Access Keys exist for the Root user.