On this page↓
When you create a brand-new AWS account, you start with the Root User — the email and password you signed up with. It is tempting to keep using it or to create an IAM User with permanent access keys (AKIA...) sitting in plain text on your laptop.
Don't do either. In this beginner-friendly guide, you will set up AWS IAM Identity Center (formerly AWS SSO) — AWS's modern, free best practice for signing into both the Console and the AWS CLI v2 using short-lived, temporary credentials.
Why Avoid the Root User and Static Access Keys?
Think of the AWS Root User like the master key to an entire bank vault: it has unrestricted access to everything (including closing your account), and no IAM policy can limit it.
The traditional workaround was creating an IAM User with long-lived Access Keys (AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY). The problem? Those keys never expire unless you manually rotate them. If they accidentally end up in a GitHub commit, anyone can spin up expensive resources on your bill.
IAM Identity Center solves this cleanly:
You sign in through a single AWS access portal (browser login).
Behind the scenes, AWS STS (Security Token Service) mints temporary credentials that automatically expire after a few hours.
Both AWS Organizations and Single-Region IAM Identity Center cost $0.00/month.
Prerequisites
A newly created AWS account (signed in as Root for this one-time setup).
AWS CLI v2 installed on your machine. Verify your version first:
aws --versionYou should see aws-cli/2.x.x (AWS CLI v1 does not support the modern aws configure sso flow).
Step 1: Enable IAM Identity Center (Watch Out for the $2/mo Trap!)
Sign in to the AWS Management Console as your Root user.
In the top-right corner, select your primary Region (for example, US East (N. Virginia)
us-east-1).Search for IAM Identity Center in the top search bar and click Enable.
When prompted to enable with AWS Organizations, continue so AWS creates your organization instance.
Quick Beginner Question: "Is an IAM Identity Center 'Instance' an EC2 Server?"
No! After clicking Enable, you will see a green banner saying you created an "organization instance of IAM Identity Center." Don't panic — there is no EC2 server running and no hourly compute charge. In IAM Identity Center, an "instance" simply means a logical, AWS-managed identity directory for your account.
Step 2: Create a User, Group, and Permission Set
Rather than attaching permissions directly to individual users, AWS best practice is to follow this clean chain:
Component | Purpose | Example |
|---|---|---|
User | Represents an individual person |
|
Group | Organizes users who share the same job function |
|
Permission Set | Defines what actions are allowed inside an AWS account |
|
AWS Account Assignment | Connects | Management Account |
Follow these steps from the IAM Identity Center left sidebar:
Create a User: Go to Users → Add user. Enter a username (e.g.,
dev-admin), your email address, and name. Open the invitation email AWS sends you and set your password.Create a Group: Go to Groups → Create group. Name it
administrators, then add your new user to this group.Create a Permission Set: Go to Permission sets → Create permission set → Predefined permission set →
AdministratorAccess. (Tip: Set Session duration to4or8 hoursso your CLI session doesn't expire mid-project.)Assign the Group to Your AWS Account: Go to AWS accounts, check the box next to your account, click Assign users or groups, switch to the Groups tab, select
administrators, and attach yourAdministratorAccesspermission set.
AWSReservedSSO_...) in that account that your user assumes via STS.Step 3: Copy Your AWS Access Portal URL
Go back to the IAM Identity Center Dashboard. On the right side under Settings summary → AWS access portal URLs, copy your AWS access portal URL. It looks like this:
textKeep this URL handy — it is your SSO start URL for the AWS CLI.
Step 4: Give the User AWS CLI Access (aws configure sso)
Open your terminal and run:
bashaws configure sso --profile my-sso-profile
Use a dedicated named --profile so your SSO setup stays isolated from any older AWS profiles on your machine. Answer each prompt as follows:
textSSO session name (Recommended): my-sso-session
SSO start URL [None]: https://d-xxxxxxxxxx.awsapps.com/start
SSO region [None]: us-east-1
SSO registration scopes [sso:account:access]: (press Enter)
Your browser will open automatically:
Sign in with the new user (
dev-admin) and password you created in Step 2.Click Allow to grant the AWS CLI access.
Return to your terminal and finish the last two prompts:
textCLI default client Region [None]: us-east-1
CLI default output format [None]: json
Step 5: Verify Your Identity and Temporary Credentials
Pin your profile and Region for your current terminal session, then run two verification commands:
bashexport AWS_PROFILE=my-sso-profile
export AWS_REGION=us-east-1
aws sts get-caller-identity
aws configure list
You should see output similar to this:
json{
"UserId": "AROAXXXXXXXXXXXXXXXXX:dev-admin",
"Account": "123456789012",
"Arn": "arn:aws:sts::123456789012:assumed-role/AWSReservedSSO_AdministratorAccess_a1b2c3d4/dev-admin"
}
And aws configure list will confirm your credentials come from sso (not static keys):
textName Value Type Location
---- ----- ---- --------
profile my-sso-profile env ['AWS_PROFILE', 'AWS_DEFAULT_PROFILE']
access_key ****************XXXX sso
secret_key ****************YYYY sso
region us-east-1 env ['AWS_REGION', 'AWS_DEFAULT_REGION']
Look closely at two details in get-caller-identity:
Arncontains:assumed-role/(never:root).aws sts get-caller-identityrequires zero IAM permissions — it is your safest pre-flight check to verify who you are and which AWS account you are targeting before creating any cloud resources.
Daily Workflow: Refreshing Expired SSO Sessions
Because SSO credentials are temporary, your token will eventually expire (for example, the next morning). You never need to re-run aws configure sso. Just run:
aws sso login --profile my-sso-profileApprove in your browser, export AWS_PROFILE=my-sso-profile, and you are right back in business.
Quick Knowledge Check
Scenario Checkpoint
Why should developers use AWS IAM Identity Center (aws configure sso) instead of storing IAM User access keys in ~/.aws/credentials?
→
aws configure sso) instead of storing IAM User access keys in ~/.aws/credentials?AKIA... access keys.
Scenario Checkpoint
Which AWS CLI command safely verifies your active IAM identity and target Account ID even if your role has zero permissions?
→
aws sts get-caller-identity — it is always allowed for any valid IAM principal and requires no explicit IAM policy.