Sub topic 9
Setting up an admin identity for daily work
This chapter assumes you have finished the earlier chapters. Your account exists, the root user has MFA, and the root user has no access keys. You should also be comfortable editing a text file and running commands in a terminal. Here you stop signing in as root and create an identity that does your day-to-day administration.
Why root should not be your daily login
The root user cannot be restricted by IAM policies. It can close the account, change billing and remove any resource. Every login is a chance for a phishing page, a shoulder-surfer or a mistyped command to cause damage you cannot undo. An administrative identity is still powerful, but you can limit it, audit it, revoke it and rotate it. You can also delete and recreate it without touching the account itself.
The root user stays for the few tasks only it can do, covered in the previous chapter. Everything else moves to the identity you create now.
Two ways to build the identity
You have two realistic options.
| Approach | Credentials | MFA | Best for |
|---|---|---|---|
| IAM Identity Center user | Short-lived, issued per session | Per user, enforced at sign-in | Anyone using the account for more than a quick test |
| IAM user with AdministratorAccess | Password, plus optional long-lived access keys | Per user | Legacy setups, or tools that cannot use SSO |
AWS recommends IAM Identity Center for human users. Sessions expire, so there are no access keys sitting in ~/.aws/credentials waiting to leak. The CLI can use the same sign-in as the console. This chapter uses Identity Center and mentions the IAM user path at the end.
How Identity Center fits together
Identity Center separates four ideas. A user is a person. A permission set is a reusable template of policies, such as AdministratorAccess. An assignment links a user (or group) and a permission set to an AWS account. The access portal is the sign-in page where the user picks an account and role.
When a user signs in and picks an assignment, Identity Center creates an IAM role in the target account. Its name starts with AWSReservedSSO_. It then hands the user temporary credentials for that role.
Step 1: Enable Identity Center
Sign in as root for this one step. You need to do the following.
- Choose your home Region first. Identity Center stores its data in one Region, and moving it later means deleting and rebuilding your configuration. Pick the Region you will use most, then open the IAM Identity Center console in that Region.
- Choose Enable. If your account is not part of an organization yet, AWS creates an AWS Organizations organization with your account as the management account. This is expected and is the starting point for the last chapter's topic.
- Leave the identity source as Identity Center directory unless your company already runs an external identity provider.
Step 2: Create the user and enforce MFA
In the Identity Center console, go to Users and choose Add user. Use a personal sign-in name and an email address you control. This should not be the root email. If someone phishes your daily login, the root mailbox stays separate.
Then open Settings, then Authentication, and require MFA when users sign in. Passkeys, security keys and authenticator apps are all supported. The factor you chose for root can differ from this one. Register at least two factors if the console allows it, so a lost phone does not lock you out.
Step 3: Create a permission set and assign it
Create a permission set from the predefined AdministratorAccess policy. Set the session duration deliberately. The default is one hour and the maximum is 12 hours. A shorter session limits the damage from a stolen token. A longer one means fewer interruptions. Four hours is a reasonable middle for a personal account.
Next, under AWS accounts, select your account and choose Assign users or groups. Pick your user and the permission set. Assigning to a group is better than assigning to a user, even for one person. When a second person joins, you add them to the group and change nothing else.
Step 4: Sign in and use the CLI
Open the access portal URL shown on the Identity Center dashboard. It looks like https://d-1234567890.awsapps.com/start. Sign in, complete MFA and choose your account. You can open the console from there or copy credentials.
For the CLI, configure a profile that uses Identity Center instead of stored keys. The interactive command is aws configure sso. The result is a pair of sections in ~/.aws/config.
[sso-session my-sso]
sso_start_url = https://d-1234567890.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access
[profile admin]
sso_session = my-sso
sso_account_id = 111122223333
sso_role_name = AdministratorAccess
region = us-east-1Replace the start URL, Region and account ID with your own. Then sign in and check who you are.
aws sso login --profile admin
aws sts get-caller-identity --profile adminThe Arn in the output should contain assumed-role/AWSReservedSSO_AdministratorAccess_ followed by a hash and your user name. If it ends in :root, you are still using root credentials. Run the same check from earlier in this tutorial if you are unsure which credentials your shell is picking up. To avoid typing the flag each time, set AWS_PROFILE=admin in your shell.
When the session expires, commands fail with a message about expired or missing tokens. Run aws sso login --profile admin again. No key rotation is needed.
Common errors
- The portal shows no accounts. The assignment is missing, or you signed in as a user who has none. Check the assignment under AWS accounts.
aws sso loginopens the wrong Region or fails.sso_regionmust be the Identity Center home Region, which can differ from theregionyou work in.- Commands still run as root. Environment variables
AWS_ACCESS_KEY_IDor an old[default]profile override your intent. Unset them or runaws sts get-caller-identityto see which wins. - Billing pages say access denied. The root-level billing access setting is not enabled yet.
- Locked out of the user. If you lose every MFA factor, the root user can reset the Identity Center user. This is a good reason to keep root recovery intact, with an accessible email and a stored MFA device.
The IAM user alternative
If you cannot use Identity Center, create an IAM user, give it a console password, attach AdministratorAccess (preferably through a group) and enable MFA for it. Do not create access keys unless a tool truly requires them. If you do, they are long-lived secrets: rotate them, never commit them to a repository and delete them when unused. This path works, but it recreates the exposure you removed from root, just at a lower level.
Keep the admin identity honest
An administrator is still a high-value target, so a few habits matter.
- Use it for setup and exceptions. Create narrower permission sets for routine work, as the next chapter discusses.
- Do not share the identity. One person, one user. CloudTrail records show who did what only if identities are not shared.
- Review assignments periodically and remove people who no longer need access.
Exercise
You run aws sts get-caller-identity and the Arn ends in :root. Name two likely causes and one fix.
Show answer
Either the shell has AWSACCESSKEYID and AWSSECRETACCESSKEY set from root access keys, or the default profile holds root keys. Fix it by unsetting the variables, deleting the root access keys in the account's security credentials page, and selecting the Identity Center profile with --profile admin or AWS_PROFILE=admin. Then rerun the command and confirm the Arn contains assumed-role/AWSReservedSSO_AdministratorAccess_.
Exercise
Why assign the permission set to a group instead of directly to your user, and why does the Identity Center home Region matter before you enable the service?
Show answer
A group assignment lets you add or remove people without editing assignments, and it keeps access reviews simple. The home Region matters because Identity Center data lives in one Region, and changing it later requires deleting your configuration and rebuilding it.