IAM Identity Center and MFA for daily work

In most companies, people reach AWS through IAM Identity Center, which gives them one sign-in and one MFA for every account they need. You’ll see how it works and why it’s better than separate IAM users, and then set up your own daily admin sign-in with MFA so root never touches the CLI again.

For learners there’s a snag. Identity Center needs AWS Organizations before it can give access to accounts, and AWS warns that creating an organization from a Free Tier account moves it to the Paid plan and ends the Free Tier credits straight away. So in your lab you’ll use an MFA-protected admin user for now and switch to Identity Center in Lesson 33.

TimeYou needBy the end you can
50 minutesThe lab account, your laptop with the AWS CLI, an authenticator app on your phone, and root access for one last time.Explain Identity Center, permission sets and the access portal, create a daily admin user with MFA, check it with a credential report, and retire the root CLI profile.

What it is, in one line

IAM Identity Center gives people one sign-in, with MFA, to every AWS account and role they’re allowed to use.

In Simple Words

One company ID card instead of a key ring

Imagine a company with ten buildings. The old way, each building hands you its own key, and when you leave, someone has to remember to collect all ten. The new way, HR gives you one ID card and every building’s door checks HR’s list, so when you leave HR cancels that one card and none of the doors open for you from that minute. IAM users are the key ring and IAM Identity Center is the ID card, but for one small lab building, a single good key with a PIN (MFA) does the job, and that’s what you’ll set up today.

Engineer's View

How Identity Center works

You enable Identity Center once, in the management account of an AWS organization, in a single Region. People either live in its own directory or come in from your company directory (Microsoft Entra ID, Okta, Active Directory) through SAML and SCIM.

You create permission sets, like AdministratorAccess or ReadOnlyAccess, and assign a user or group together with a permission set to an account. Identity Center then creates a role in that account with a name like AWSReservedSSO_AdministratorAccess_1a2b3c..., and signing in through the AWS access portal or aws sso login gets you short-lived credentials for that role.

A standalone account can only have an account instance of Identity Center, which works for some AWS applications but can’t give access to the AWS account itself. The organization instance can, and turning it on creates an organization with your account as the management account, so read the Free Tier warning in the intro before you try that in your lab.

Until then, the safe setup for a single account is an IAM user for you in an admin group, with an MFA device, signing in to the CLI through aws login, and no access keys anywhere.

How it works, step by step

This is how your daily routine changes after this lesson.

1Root goes into the safe

Root comes off the CLI. It keeps its MFA and only gets used for the handful of account-level tasks that need it.

IAM Identity Center lesson: the daily sign-in flow with aws login and MFA

2You get your own admin identity

yourname.admin sits in the lab-admins group with AdministratorAccess and has to use MFA to sign in. At a company, this identity would come from Identity Center with a permission set.

3You sign in with aws login

From Lesson 7 on, every lab starts with aws login --profile saat-admin. The browser asks for your password and MFA code, and the CLI gets credentials that expire.

4You check access regularly

The IAM credential report lists every user, whether they have MFA on and whether they have access keys. It’s the first thing an auditor or a new admin looks at.

The comparison below explains why companies switch to Identity Center as soon as they have more than one account or more than a few people.

IAM Identity Center compared with IAM users

Look at the last row of each card. Offboarding is where IAM users let real companies down, because a single forgotten user in a single account is enough for a former employee, or a stolen password, to keep working.

✅ Checkpoint: You can explain why Identity Center needs Organizations and what a permission set is, and why your lab uses an MFA-protected IAM user for now.

Hands-on lab: an MFA admin user now, IAM Identity Center later

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Work in PowerShell from C:\aws-lab. In the first command, replace yourname with your real first name; everything after that uses the variable.

1Sign in as root for the last time

Run this:

aws login --profile saat-root
$env:AWS_PROFILE = 'saat-root'
$acct = aws sts get-caller-identity --query Account --output text
$me = 'yourname.admin'

2Create the admin group and your user

Paste this whole block:

aws iam create-group --group-name lab-admins
aws iam attach-group-policy --group-name lab-admins --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
aws iam attach-group-policy --group-name lab-admins --policy-arn arn:aws:iam::aws:policy/SignInLocalDevelopmentAccess
aws iam create-user --user-name $me --tags Key=course,Value=saatvedha-aws --query User.Arn --output text
aws iam add-user-to-group --user-name $me --group-name lab-admins
$pw = 'Lab-' + [guid]::NewGuid().ToString('N').Substring(0,16) + '!a1'
aws iam create-login-profile --user-name $me --password $pw --password-reset-required --query LoginProfile.UserName --output text
"First password: $pw"

You should see something like this:

arn:aws:iam::123456789012:user/yourname.admin
yourname.admin
First password: Lab-8d2e0f41a7c93b55!a1

3Register an MFA device for the user

Create a virtual MFA device and save its QR code as an image:

$serial = aws iam create-virtual-mfa-device --virtual-mfa-device-name $me --outfile C:\aws-lab\mfa-qr.png --bootstrap-method QRCodePNG --query VirtualMFADevice.SerialNumber --output text
$serial
Start-Process C:\aws-lab\mfa-qr.png

Scan the QR code with your authenticator app (Google Authenticator, Microsoft Authenticator or something similar). Wait for one 6-digit code, then wait for the next one, and use both:

aws iam enable-mfa-device --user-name $me --serial-number $serial --authentication-code1 111111 --authentication-code2 222222
aws iam list-mfa-devices --user-name $me --query 'MFADevices[].SerialNumber' --output text
Remove-Item C:\aws-lab\mfa-qr.png

Put your two codes in place of 111111 and 222222. The second command should show something like this:

arn:aws:iam::123456789012:mfa/yourname.admin

Delete the QR image as shown, because anyone who has it can copy your MFA device.

4Sign in as yourself

Run this, then in the browser sign in as yourname.admin at your alias sign-in page (change the password and enter your MFA code):

Remove-Item Env:AWS_PROFILE
aws login --profile saat-admin
$env:AWS_PROFILE = 'saat-admin'
aws sts get-caller-identity --query Arn --output text

You should see something like this:

arn:aws:iam::123456789012:user/yourname.admin

5Check everyone with the credential report

Run this, and if it says STARTED, run the first line again:

aws iam generate-credential-report --query State --output text
$b64 = aws iam get-credential-report --query Content --output text
[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b64)) | ConvertFrom-Csv |
    Select-Object user, password_enabled, mfa_active, access_key_1_active | Format-Table

You should see something like this:

user           password_enabled mfa_active access_key_1_active
----           ---------------- ---------- -------------------
<root_account> not_supported    true       false
yourname.admin true             true       false

Every human row should say mfa_active true and access_key_1_active false. Root shows not_supported in the password column, and that’s normal.

IAM Identity Center lesson lab: admin user check and credential report
Example output. Your account number and user name will be different.

6Retire the root profile

Sign root out, then open the config file:

aws logout --profile saat-root
notepad $env:USERPROFILE\.aws\config

Delete the three lines under [profile saat-root], save and close. Every lab from now on starts with aws login --profile saat-admin.

7Look at Identity Center (don’t enable it yet)

In the console, open IAM Identity Center and read the enable page, including the note about AWS Organizations, but choose Cancel. You’ll enable it in Lesson 33 once you’ve decided about the plan and credits.

✅ Checkpoint: get-caller-identity shows your admin user, the credential report shows MFA on and no access keys, and [profile saat-root] is no longer in your config.

Break It, Then Fix It

Almost everyone runs into both of these at some point.

1Break it: the same MFA code twice

To enable a virtual MFA device, AWS asks for two consecutive codes, which proves your phone’s clock is in step. Typing the same code twice (or two codes far apart) won’t work. Try it with a test device:

$serial2 = aws iam create-virtual-mfa-device --virtual-mfa-device-name test-mfa --outfile C:\aws-lab\test-qr.png --bootstrap-method QRCodePNG --query VirtualMFADevice.SerialNumber --output text
aws iam enable-mfa-device --user-name $me --serial-number $serial2 --authentication-code1 482913 --authentication-code2 482913

You’ll get an error something like this:

An error occurred (InvalidAuthenticationCode) when calling the EnableMFADevice operation: Authentication code for device is not valid.

Fix: wait for a fresh code and then the next one, and enter them in that order. If your codes keep getting rejected, check that your phone sets its time automatically. For this test, delete the unused device:

aws iam delete-virtual-mfa-device --serial-number $serial2
Remove-Item C:\aws-lab\test-qr.png

2Break it: an old script still uses the root profile

Write a tiny script the way people do in their first week, and run it:

"aws sts get-caller-identity --profile saat-root --query Arn --output text" | Set-Content .\old-report.ps1
.\old-report.ps1

You’ll get this error:

The config profile (saat-root) could not be found
IAM Identity Center lesson break lab: invalid MFA code and a removed profile
Both errors in one window, looking something like this.

This is what you want to see, because anything still built on root breaks loudly and you get to find it. Fix: point the script at your own profile.

(Get-Content .\old-report.ps1) -replace 'saat-root','saat-admin' | Set-Content .\old-report.ps1
.\old-report.ps1

You should see something like this:

arn:aws:iam::123456789012:user/yourname.admin

✅ Checkpoint: You fixed an MFA enable error with two fresh consecutive codes, and you found and fixed a script that still pointed at root.

This happened at work

The contractor who never really left

A media company had twelve AWS accounts and had been creating IAM users in each one by hand. When a contractor finished his project, he was removed from the company directory on his last day, but nobody remembered his IAM users. Three of the twelve accounts got cleaned up and the other nine didn’t.

Four months later Amazon GuardDuty flagged one of his old access keys listing S3 buckets from an IP address in another country. It wasn’t him; his laptop had been sold without being wiped. Nothing got deleted, but the team spent a week proving what had and hadn’t been read.

After that the company moved everyone onto IAM Identity Center connected to its directory with SCIM, so switching someone off in the directory takes away their AWS access everywhere within minutes. A service control policy now blocks anyone from creating new IAM users with console passwords or keys, apart from a short list of service accounts.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do
Using root on the CLI “just for this week”Every mistake has full power and no limitsUse your own admin user (now) or Identity Center (Lesson 33)
Enabling Identity Center on the Free plan without reading the warningThe account moves to the Paid plan and the Free Tier credits endWait for Lesson 33 and make the decision on purpose
Same MFA code entered twiceInvalidAuthenticationCodeTwo fresh, consecutive codes; phone time set automatically
Keeping the MFA QR code pictureAnyone with the file can copy your MFADelete it right after scanning
IAM users created by hand in many accountsPeople who leave keep access in the accounts you forgetIdentity Center with a company directory and SCIM
Old scripts with --profile saat-rootThey break after root is retiredSearch scripts for the profile name and change it to saat-admin

Interview questions

Click a question to open it. Each one is worded the way an interviewer might ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. Can you tell me in simple words what IAM Identity Center is?

Why they ask this: They want to know you’re familiar with how people sign in to AWS today. Lots of teams still run old IAM users, so this shows you’re current.

How you might answer: It’s the AWS service for staff sign-in. People sign in once with MFA and get access, with temporary credentials, to the accounts and permission sets assigned to them. It can run its own directory or use a company one like Entra ID.

2. A new teammate keeps signing in as root because it’s easier. What would you tell them?

Why they ask this: They’re checking basic security habits and whether you can explain the risk without lecturing.

How you might answer: I’d explain that root has unlimited power and no IAM policy can limit it, so one mistake or one stolen session could be a disaster. Root is only for a few account-level jobs, and for daily work they should use their own named identity with MFA.

3. How would you explain a permission set to someone who has only used IAM users before?

Why they ask this: They want to check you know the Identity Center vocabulary and how it maps onto normal IAM, which helps a lot when you debug access.

How you might answer: I’d describe a permission set as a template of policies, like AdministratorAccess or ReadOnlyAccess. Once you assign it to a user or group for an account, Identity Center creates a matching role inside that account.

2–5 years experience

4. Your security lead asks for a list of users who have no MFA or old access keys. How would you get it?

Why they ask this: They want to see practical auditing skills, since answering security questions with data is part of the daily job.

How you might answer: I’d generate the IAM credential report and go through columns like mfa_active, password_last_used, access_key_1_active and access_key_1_last_used_date for every user. If we’re running an organization, I’d add IAM Access Analyzer and AWS Config rules to check all the accounts.

5. What’s the difference between an organization instance and an account instance of Identity Center, and when would you use each?

Why they ask this: They want to see your product knowledge is current, because choosing the wrong instance type can block access to accounts later on.

How you might answer: An organization instance lives in the management account and can give people access to every account in the organization, so that’s the one I’d use for staff access to AWS. An account instance is tied to one account and meant for application access, and it can’t give people access to the AWS account itself.

6. Someone leaves the company today. With Identity Center and SCIM in place, what happens to their AWS access?

Why they ask this: They want to know you understand offboarding from start to finish, including what happens to sessions that are already open.

How you might answer: HR or IT disables them in the company directory, SCIM syncs that across to Identity Center, and they can’t sign in any more. Sessions they already have open only end when the session duration runs out, though, which is why I keep sessions short for sensitive roles.

Senior level

7. A company has 40 accounts with IAM users everywhere. How would you plan the move to Identity Center?

Why they ask this: They’re looking for a safe migration done in steps, and for you to lock the door behind you so the old habits don’t creep back.

How you might answer: I’d switch on the organization instance, connect the company directory with SCIM and design a few permission sets per job, assigned through groups. One team would go first as a test, then the rest would move across, with their IAM users disabled after a short overlap. App keys get replaced with roles. At the end I’d use SCPs to stop anyone creating new IAM users, and run credential reports to catch whoever got left behind.

8. How would you protect the root users across 40 accounts without 40 MFA devices in a drawer?

Why they ask this: They want to know if you’ve heard of centralised root access management, which shows you can handle security problems at scale.

How you might answer: I’d use the centralised root access feature in AWS Organizations to remove root credentials from the member accounts, so nobody can sign in as root there at all, and the management account handles the rare root tasks for them. The management account’s own root keeps strong MFA, with the device stored safely and two named owners.

Quick quiz

Q1. What does IAM Identity Center need to give people access to AWS accounts?

  1. An account instance
  2. An organization instance in AWS Organizations
  3. Access keys for every user
  4. A VPN
Show answer

B: only an organization instance can give access to AWS accounts through permission sets.

Q2. What does AWS warn about creating an organization from a Free Tier account?

  1. Nothing changes
  2. It switches to the Paid plan and Free Tier credits end
  3. It deletes all resources
  4. It disables MFA
Show answer

B: the Identity Center documentation warns that the account moves to the Paid plan and the credits expire.

Q3. When enabling a virtual MFA device, what must the two codes be?

  1. The same code twice
  2. Two consecutive codes
  3. Any two codes from that day
  4. The account number
Show answer

B: two consecutive codes prove your device’s clock matches AWS.

Q4. In the credential report, which values do you want for a human user?

  1. mfa_active false, access key true
  2. mfa_active true, access key false
  3. password_enabled false
  4. not_supported everywhere
Show answer

B: people should have MFA turned on and no long-term access keys.

Q5. What should you do with the MFA QR code image after scanning it?

  1. Email it to yourself
  2. Keep it in the lab folder
  3. Delete it
  4. Upload it to S3
Show answer

C: the image holds the secret, so anyone who has it can generate your codes.

Quick recap

  • IAM Identity Center gives people one sign-in with MFA to many accounts through permission sets.
  • It needs an organization instance, and creating an organization from a Free Tier account ends the credits, so your lab moves to it in Lesson 33.
  • Your daily identity from now on is yourname.admin with MFA, signing in with aws login --profile saat-admin.
  • The credential report shows MFA and access keys for every user, and humans should have MFA on and keys off.
  • Root is off the CLI for good, and any old script that still uses it fails loudly, which is how you find it.

Next lesson

Lesson 7: IAM policies in depth → Next you’ll write your own JSON policies with conditions and test them before handing them to anyone.

Further reading: IAM Identity Center

If you want to go further with IAM Identity Center, read What is IAM Identity Center? and Getting credential reports for your AWS account. The full plan for this course is on the AWS Cloud Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.