AWS Console Session Timeout: How to Change It (and the 90-Day Login)

Logeshwaran
—

AWS’s new 90-day sign-in setting covers the AWS CLI, not the console: console sessions still last 12 hours at most. Here’s every timeout, and how to change it.

Jake runs a small phone repair shop, and like a lot of small shops now, his stock list lives in AWS: a tiny server syncs it to his website every night. On November 24 he read the headline he’d wanted for two years: AWS would let people “stay authenticated for up to 90 days”. He opened IAM, set his own user to 90 days and closed the laptop feeling clever.

At 9:14 the next morning, with a customer at the counter waiting for a refund, the AWS console logged him out. He typed his password, found his phone for the MFA code, and the customer watched him do it twice. It was exactly 12 hours since he’d signed in.

“That setting isn’t for your browser,” Ethan told him that evening. Ethan does cloud work for a living and has been Jake’s unpaid IT department for years. “The new Sign-in duration is for the AWS CLI’s aws login command, the AWS MCP Server and other tools that sign in through OAuth. It doesn’t touch the AWS Management Console. And as an IAM user, your console gets 12 hours, full stop. Nothing changes that.”

The short version: your AWS console session timeout depends on how you sign in. IAM users get a fixed 12 hours. Roles get their Maximum session duration, 1 to 12 hours. SAML sign-ins get 15 minutes to 12 hours from your identity provider. IAM Identity Center gives 1 to 12 hours per permission set, 1 hour by default. To work longer in the console, raise the setting for your sign-in type. To stop re-typing passwords in the terminal, use aws login with the new Sign-in duration, up to 90 days.

Below is how Jake untangled it: every console timeout and where it lives, why switching roles cut his helper’s day short, how Ethan moved the shop’s stock-sync job off a two-year-old access key, what they did when Jake thought he’d lost his laptop, and the aws login errors they hit along the way.

AWS console session timeout setting: the quick answer for each sign-in type

Ethan grabbed the back of a repair ticket and drew a table. “AWS doesn’t have one console timeout,” he said. “It has one for every way of signing in. Most people never notice until they get thrown out in the middle of something, like you did.”

How you sign inConsole session lastsCan you change it?Where
IAM user (account ID, user name, password)12 hoursNoNo setting exists
Root user (email and password)Not publishedNoNo setting exists; avoid daily root use
Switch role from an IAM userRole maximum or time left in your session, whichever is lessYes, the role partIAM › Roles › Maximum session duration (1–12 h)
Role chaining (a role switching to another role)1 hour, alwaysNoHard limit
SAML federation (Okta, Entra ID, ADFS and others)15 minutes to 12 hours; 1 hour if not setYesSessionDuration attribute in your identity provider, capped by the role maximum
IAM Identity Center (AWS access portal)1 to 12 hours per account, 1 hour by defaultYesPermission set › Session duration
IAM Identity Center portal itself8 hours by default, 15 minutes to 90 daysYesSettings › Authentication › Session duration

Then he added two more rows under a line, for things that aren’t console timeouts at all:

ToolSession lastsCan you change it?Where
aws login (AWS CLI), AWS MCP Server, OAuth apps12 hours by defaultYes, 1 hour to 90 daysIAM › user or role › Sign-in duration
aws sso login (Identity Center users)Access portal session, then permission set timeYesIAM Identity Center settings

Jake: "So the 90-day thing was never for my browser?"

Ethan: "Never. It’s for your terminal and your AI tools. Your browser follows whatever your sign-in type allows, and for an IAM user that’s 12 hours."

What changed on November 23: the 90-day Sign-in duration in plain English

“Think of a cinema with a wristband,” Ethan said. “When you sign in with aws login, AWS gives you a wristband, a sign-in session. While you wear it, the CLI can walk up to the counter and get a fresh ticket, a short-lived set of credentials, whenever the old one is about to run out. You never see it happen.”

“Until November 23, every wristband expired after 12 hours at most. Now an administrator can set how long it lasts, per IAM user or per role, anywhere from 1 hour to 90 days. If nobody sets it, nothing changes: 12 hours by default, and a role without the setting falls back to its existing maximum session duration.”

Jake asked the obvious question: why does anyone need a wristband for 90 days? Ethan pointed at the little server under the counter. Two years ago, Jake had pasted an access key into its stock-sync script because the 12-hour sessions kept breaking the nightly job. That key had never expired since. AWS pitches the new setting as a safer alternative to exactly that kind of static key, and the timing fits the rise of AI agents and scheduled jobs that run for days. In October, CLI users had openly asked for aws login sessions longer than 12 hours for unattended servers. Seven weeks later, they got up to 90 days.

Three details matter more than the headline:

  • It isn’t the role’s Maximum session duration. That older setting still controls how long each ticket lasts, 1 to 12 hours. Sign-in duration controls how long the wristband lets you keep getting new ones. For aws login, the sign-in duration wins.
  • It only affects new sessions. Change it while signed in, and you have to run aws login again to get the longer wristband.
  • It works with OAuth sign-ins only: the AWS CLI’s aws login, the AWS MCP Server, and other tools that sign in through OAuth. Console sessions and classic role assumption with aws sts assume-role don’t change.

What you need

  • AWS CLI 2.32.0 or later to use aws login, and 2.41.1 or later to set the sign-in duration and manage sessions from the CLI. The IAM console works with any CLI version.
  • Console credentials. aws login uses the same identity as the browser: root, an IAM user with a console password, or a role you federate into. On IAM users, the setting lives on the login profile, which is the console password record.
  • The SignInLocalDevelopmentAccess managed policy on the user, role or group. The root user doesn’t need it.

How to increase AWS console session timeout (what you can and can’t change)

Jake’s next question was the one most people search for: fine, so how do I make the console last longer? Ethan’s answer depended on how each person in the shop signs in, so they went through them one by one.

IAM users: 12 hours, fixed

That’s Jake. An IAM user’s console session lasts 12 hours, and there’s no setting to change it, longer or shorter. Setting the Sign-in duration to 90 days on an IAM user changes the CLI and nothing in the browser. “If 12 hours isn’t right,” Ethan said, “the fix isn’t a setting. It’s giving people roles, or moving the shop to IAM Identity Center, where you choose the duration.”

Switching roles: up to 12 hours, but never past your own session

Priya, who helps in the shop on Saturdays, signs in as an IAM user and then switches to a “StoreManager” role to update prices. Last Saturday she got thrown out at 2 p.m. and lost a half-finished price update. Here’s why. When you switch to a role in the console, the role session gets the role’s Maximum session duration, 1 to 12 hours, 1 hour by default. But you get that maximum or the time left in your own session, whichever is less. Priya had signed in at 6 a.m. and switched at 10, so even a 12-hour role could only give her the 8 hours left of her own day. Switching roles can’t extend a day.

You’ve been signed in as an IAM user for…Role maximumYour role session lasts
1 hour (11 hours left)10 hours10 hours
8 hours (4 hours left)10 hours4 hours
2 hours (10 hours left)1 hour (the default)1 hour
Any time, then you switch again from that roleAny1 hour (role chaining)

Her real problem was the third row: the StoreManager role still had the 1-hour default. And the last row is a trap Ethan sees at work all the time: role chaining, using one role to assume another, is always capped at 1 hour, in the console, the CLI and the API, whatever the roles allow. Teams that bounce from a “hub” role into others get hourly logouts and blame AWS.

Ethan raised the StoreManager role to 8 hours. To do the same:

  1. Open the IAM console and choose Roles.
  2. Choose the role, and in the Summary section choose Edit.
  3. Under Maximum session duration, pick a value up to 12 hours, or choose Custom duration and enter seconds.
  4. Choose Save changes. The new value applies the next time someone assumes the role, so switch back and forth once to pick it up.

From the CLI, the same change is one line (43,200 seconds is 12 hours):

aws iam update-role --role-name DeveloperRole --max-session-duration 43200

Some service consoles renew an expired role session on their own; others ask you to reload the page. Either is normal.

SAML federation: the SessionDuration attribute

At Ethan’s day job, people sign in through Microsoft Entra ID, and there the identity provider decides. It sends an attribute named https://aws.amazon.com/SAML/Attributes/SessionDuration, in seconds, from 900 (15 minutes) to 43,200 (12 hours). If it sends nothing, you get 1 hour. The role’s maximum session duration still caps it, so raise both. If the assertion also carries SessionNotOnOrAfter, the shorter of the two wins.

IAM Identity Center: two timers

Ethan’s company later moved to IAM Identity Center, and for a month the developers complained they were signed out “at random”. It wasn’t random. Identity Center users live with two separate clocks:

  • The permission set’s Session duration controls how long you stay in an AWS account’s console (and CLI) after choosing it in the access portal: 1 to 12 hours, 1 hour by default. Change it under Multi-account permissions › Permission sets, choose the set, then Edit next to General settings. Identity Center reprovisions every account that uses it.
  • The access portal session controls how long you stay signed in to the portal itself: 8 hours by default, anywhere from 15 minutes to 90 days. Change it under Settings › Authentication › Session duration › Configure. Changes apply to new sessions.

The last mystery took them a week: everyone was signed out at about 6 p.m., ten hours after arriving. Their identity source was AWS Managed Microsoft AD, whose Kerberos tickets last a fixed 10 hours, so portal sessions end at 10 hours even when Identity Center says 12. AD Connector has the same 10-hour default, set in your own Active Directory. Our IAM Identity Center explainer covers the rest of the setup.

Root user

There’s no setting for the root user’s console session either, and the root user can’t switch roles. Jake admitted he still signed in as root “sometimes”. Ethan’s fix for root timeouts was to stop using root for daily work; our root user vs IAM user guide explains why.

Jake: "So for a full working day in the console?"

Ethan: "Use a role or a permission set at 8 to 12 hours, and switch to it first thing in the morning. Every hour you wait before switching eats into it."

Is there an AWS console idle session timeout?

Jake’s next idea was the opposite: the shop computer sits by the counter, so could AWS log out after ten minutes of nobody touching it? Ethan shook his head. The AWS Management Console has no idle timeout, and no setting to add one. A session ends when its duration runs out, whether you’ve been busy all day or left the tab open over lunch. The 20-minute idle timeout people find in searches belongs to Systems Manager Session Manager, the tool for shell sessions on servers. It doesn’t touch the console.

What they did instead, and what you can do if an audit wants shorter console sessions:

  • Give people roles or permission sets with a 1-hour session, and no IAM user console access for daily work.
  • Send a short SessionDuration from your identity provider for sensitive roles.
  • Use Revoke sessions on a role’s summary page in the IAM console when something looks wrong. It disables that role’s active console sessions at once.
  • Restrict where people can sign in from. AWS Sign-In now accepts resource-based policies that can block console and CLI sign-ins from outside your network ranges.

And for the counter computer, the oldest advice still works: lock the screen when you walk away. A session that’s still valid is valid for whoever sits down.

How to login to AWS from command line: aws login step by step

Jake’s laptop, Windows 11 with Ubuntu running in WSL, still had the same old access key in a file. Ethan replaced it with aws login, which signs the CLI in with the same identity as the console, through the browser, and keeps fresh temporary credentials coming. The commands are the same on Windows 11, macOS and Linux, including Kali.

  1. Update the AWS CLI to version 2.32.0 or later; 2.41.1 or later if you also want to manage sign-in durations and sessions from the terminal. Check with aws --version.
  2. Give the identity permission. Attach the SignInLocalDevelopmentAccess AWS managed policy to the IAM user, role or group.
  3. Run aws login, or aws login --profile shop for a named profile. If the profile has no Region yet, the CLI asks for one.
  4. Pick the identity in the browser. Choose one of your active console sessions or sign in, then return to the terminal.
  5. Test it with aws sts get-caller-identity. You should see your user or role ARN.
  6. Sign out when you’re done with aws logout, aws logout --profile shop, or aws logout --all for every login profile.

After step 3, the config file gets a short profile with no keys in it, which made Jake visibly relax:

[default]
login_session = arn:aws:iam::123456789012:user/jake
region = us-east-1

The temporary credentials live in ~/.aws/login/cache on Linux and macOS, or %USERPROFILE%\.aws\login\cache on Windows. Set AWS_LOGIN_CACHE_DIRECTORY to keep them somewhere else. Then Ethan deleted the old access key in IAM, the first time in two years it had been anywhere but a text file.

No browser on the machine? Use --remote

The stock-sync server under the counter has no screen, let alone a browser. For machines like that, aws login --remote prints a sign-in URL; Ethan opened it on his phone, signed in, and pasted the authorization code it showed back into the server’s terminal. With a long sign-in duration on that server’s role, that one sign-in now covers weeks of nightly syncs.

How much time is left on my session?

The console doesn’t show a countdown, so note when you signed in and do the math from the table above. In the terminal, two commands help. aws configure export-credentials --profile shop --format process prints the current temporary credentials with an Expiration time; with aws login that’s only the next refresh, usually minutes away. For the sign-in session itself, aws signin list-sessions --principal-arn with your user or role ARN lists each session with its expiration time and status.

Older tools that don’t understand aws login

Jake’s stock-sync tool was older than aws login and didn’t understand it. The workaround is to let the CLI hand it credentials through credential_process:

[profile signin]
login_session = arn:aws:iam::123456789012:user/jake
region = us-east-1

[profile process]
credential_process = aws configure export-credentials --profile signin --format process
region = us-east-1

Run aws login --profile signin once, then point the old tool at the process profile. If profiles and config files confuse you, our AWS CLI profile not found guide explains how the two files fit together.

Jake: "Do I still need access keys for anything?"

Ethan: "For your laptop, no. aws login covers the CLI and the SDKs. Keep access keys for the rare machine that truly can’t sign in, and rotate them."

How to set the 90-day Sign-in duration for a user or role

Ethan didn’t give everything 90 days. He set it on each identity separately, which is the point: there’s no account-wide switch, so the server’s role can get 30 days while Jake’s own user gets a week.

In the IAM console

  1. Open the IAM console and choose Users or Roles.
  2. Choose the user or role, and in the Summary section choose Edit.
  3. Under Sign-in duration, pick a value, or choose Custom duration for anything up to 90 days. For roles, don’t confuse it with Maximum session duration, which sits next to it.
  4. Choose Save changes, then run aws login again on the machine that should get the longer session.

With the AWS CLI

The value is in seconds, from 3,600 (1 hour) to 7,776,000 (90 days). These options need AWS CLI 2.41.1 or later.

# a role: 30 days
aws iam update-role --role-name DeveloperRole --max-signin-session-duration 2592000

# an IAM user (it lives on the user's login profile): 7 days
aws iam update-login-profile --user-name jake --max-signin-session-duration 604800

# back to the default behavior
aws iam update-role --role-name DeveloperRole --reset-max-signin-session-duration

# check what a role has now
aws iam get-role --role-name DeveloperRole
You wantSeconds
1 hour (the minimum)3,600
12 hours (the old ceiling)43,200
1 day86,400
7 days604,800
30 days2,592,000
90 days (the maximum)7,776,000

Changing a user’s sign-in duration doesn’t change their password or the “must reset password” flag. Two places the setting won’t go: the root user and service-linked roles.

Is a 90-day AWS session safe? How to watch and revoke sessions

Three days later, Jake left his laptop on a bus. He called Ethan in a panic: a 7-day session was sitting on that disk. “Better than the access key it replaced,” Ethan said, already typing. “That key would have worked forever. This session we can see and switch off.”

That’s the honest trade-off. Compared with long-term access keys, a sign-in session ends on its own, uses short-lived credentials, and can be listed and revoked. Compared with a 12-hour session, it gives anyone who copies the login cache days or weeks instead of hours. Our leaked access key guide shows what an attacker does with even a short window.

List and revoke sessions

Here’s what Ethan ran from his own machine (AWS CLI 2.41.1 or later). Administrators can manage any user’s or role’s sessions; people can manage their own:

# list sign-in sessions for a role (or a user ARN)
aws signin list-sessions --principal-arn arn:aws:iam::123456789012:role/DeveloperRole

# details for one session
aws signin get-session --session-arn arn:aws:signin:us-east-1:123456789012:session/SESSION-ID

# revoke one or more sessions
aws signin batch-revoke-sessions --session-arns arn:aws:signin:us-east-1:123456789012:session/SESSION-ID

Two things he warned Jake about. Revocation can take up to an hour to take effect, and access tokens already issued keep working until they expire. And revoking one session doesn’t touch the user’s other sessions, so list them all. So while the revocation went through, he also removed Jake’s permissions for an hour. (The laptop turned up at the bus depot the next day, untouched. The habit stayed.)

How long should you choose?

UseOur suggestionWhy
Your own laptop, daily CLI work1 to 7 daysFewer sign-ins without leaving a stolen laptop open for months
AI coding agent on your machineMatch the project, often 7 daysAgents run long tasks; keep their role’s permissions narrow
Unattended server or scheduled jobs30 to 90 days, with --remote sign-inReplaces stored access keys; give the role only what the jobs need
Admin or production rolesLeave the default (12 hours) or shorterThe blast radius is too big for long sessions

Those are our recommendations, not AWS rules. The principle behind them is the same one that applies to every permission: don’t set a duration longer than the work needs.

Watch it in CloudTrail

Every token AWS Sign-In issues or renews shows up in CloudTrail as a CreateOAuth2Token event from signin.amazonaws.com. Extended sessions are marked with "SignInSessionExtended": "true" and carry the session ARN, so you can search for long sessions and see which tools they belong to. For extended sessions, use the AWS credential daemon if your setup supports it: it keeps refresh tokens encrypted on disk and hands the CLI and SDKs only short-lived credentials.

Jake: "Ninety days still sounds like a lot."

Ethan: "It is, for a person. For the stock-sync job, which had a key that never expired, 30 days is a huge step up. Pick the duration for the job, not the biggest number on the slider."

aws login vs aws sso login vs access keys: which should you use?

By the end of the week, the shop had all three kinds of credentials in one place or another, so Ethan wrote down which was which.

aws loginaws sso loginAccess keys
Who it’s forIAM users, root, roles you federate intoIAM Identity Center usersAnything, but best avoided
Sign-inBrowser, same identity as the consoleBrowser, through the AWS access portalNone; keys in a file
Session length12 hours by default; 1 hour to 90 days per user or rolePortal session (8 h default, up to 90 days) plus permission set timeUntil the key is deleted
Who sets the lengthIAM administrator, per user or roleIdentity Center administratorNobody
Revokeaws signin batch-revoke-sessionsEnd the user’s sessions in Identity CenterDeactivate or delete the key
Minimum CLI2.32.0 (2.41.1 for the new settings)2.9 for session managementAny

If your company already uses Identity Center, keep using aws sso login. If you’re a solo developer or a small business with IAM users, like Jake, aws login is the easy win, and the new sign-in duration finally makes it practical for long-running jobs. When aws sso login fails with “Token has expired and refresh failed”, our SSO token expired fix walks through it.

AI agents and the AWS MCP Server: why this setting exists

Jake’s nephew had started using an AI coding assistant on the shop website, and it wanted AWS access too. The AWS MCP Server lets assistants like that call AWS, and it signs in through the same AWS Sign-In flow as aws login. An agent that works on a project for three days, or a nightly job that checks costs, used to hit the 12-hour wall and stop, or tempt someone to hand it a permanent key. The Sign-in duration fixes that without one.

Ethan set two rules. The agent got its own role, allowed to touch only the website’s bucket and nothing else, with the longer duration on that role, never on Jake’s admin user. And once a week someone glances at CloudTrail for CreateOAuth2Token events from that role, to see what it’s been up to. Our IAM explainer covers least-privilege policies if you’re building a role like that for the first time.

aws login not working: errors and fixes

aws login is about a year old, and Jake managed to hit half of its known problems in one week. The AWS CLI issue tracker shows other people hitting the same ones. Here they are, with what fixed them.

“The refresh token has expired” right after signing in

Jake’s very first try on the WSL laptop ended with An error occurred (AccessDeniedException) when calling the CreateOAuth2Token operation: The refresh token has expired., seconds after signing in. In almost every reported case, the computer’s clock is wrong, and WSL is the usual suspect. Resync Windows time (w32tm /resync from an elevated prompt, or Settings › Time & language › Sync now), run wsl --shutdown, then sign in again. It worked first time for Jake after that.

The browser shows 400 Bad Request and the CLI hangs

Stale AWS cookies can make the sign-in page return 400 Bad Request instead of sending you back to the CLI, which then waits up to 10 minutes before giving up. Press Ctrl+C, open the sign-in link in a private window or clear your AWS cookies, and try again. One person with the same symptom found the real cause was a missing SignInLocalDevelopmentAccess policy, so check permissions too.

“7178 (AWS_ERROR_CAL_UNSUPPORTED_KEY_FORMAT): Key format is not supported”

This one looks scary and isn’t your fault. About 1 in 200 to 250 sign-ins writes a key to the login cache that the CLI can’t read back, so the next refresh fails with this raw error. Run aws login again; a new key is generated and it works. A fix was in review on the CLI’s GitHub as of November 2026.

“Your session has expired” every morning

That’s the default 12-hour sign-in session ending, the same wall the stock-sync job used to hit. Ask your administrator to set a longer Sign-in duration on your user or role, then run aws login once more to start a session that uses it. A credential_process profile can’t call aws login for you, because signing in needs a browser.

aws login command not found, or “Invalid choice”

If aws login fails with aws: error: argument command: Invalid choice, your CLI is older than 2.32.0, the first version with the command. If the shell says aws: command not found, the CLI isn’t installed or isn’t on your PATH. An unknown option error for --max-signin-session-duration, or a missing aws signin list-sessions, means it’s older than 2.41.1. Update the CLI, and on Linux, check that which aws points at the new install and not an old one from a package manager. (Jake’s did.)

Credentials expire in under an hour

There’s no background process refreshing your credentials. The CLI renews them when you run a command and they’re close to expiring. If a long-running tool has its own copy of the credentials, it can run out between your commands; point it at a credential_process profile so it asks the CLI each time. For the classic ExpiredToken error from roles and STS, see our ExpiredToken explainer.

Sign-in duration changed, but nothing happened

The setting applies to new sessions only. Run aws logout and aws login again. And remember it never affects the console, the 1-hour cap on role chaining, or Identity Center sessions.

Real-world setups: what we’d configure

Here’s where Jake’s shop ended up, plus the setups Ethan uses for the bigger teams he works with:

  • A solo owner with an IAM user (Jake). Console: 12 hours, nothing to change. CLI: aws login with a 7-day sign-in duration, MFA on the user (our MFA setup guide), and no access keys on the laptop.
  • Helpers who switch roles (Priya). Work roles at 8–12 hours, switch first thing in the morning, and no role chaining, which always caps at 1 hour.
  • A company on IAM Identity Center. Permission sets at 8–12 hours for daily work and 1 hour for admin sets, and the portal session matched to the working day. With AWS Managed Microsoft AD, expect a 10-hour ceiling.
  • A server or nightly job (the stock sync). A dedicated role with narrow permissions, a 30-day sign-in duration, one aws login --remote, and a calendar reminder to sign in again before it ends. The old access key deleted.
  • An AI coding agent. Its own role, a sign-in duration that matches the project, and a weekly look at CloudTrail.

Jake: "And if someone just wants the console to stop logging them out?"

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Security – Specialty (SCS-C03) • Solutions Architect – Associate (SAA-C03) • CloudOps Engineer – Associate (SOA-C03) • Developer – Associate (DVA-C03 from December 1, 2026).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. An administrator sets the new Sign-in duration to 90 days on an IAM user, but the user is still signed out of the AWS Management Console after 12 hours. Why?

Sign-in duration applies only to OAuth sign-in sessions, such as aws login in the AWS CLI and the AWS MCP Server. IAM user console sessions last 12 hours, and there is no setting to change that.

2. A team runs scheduled AWS CLI jobs on a server and must not store long-term access keys. Today the jobs fail every 12 hours until someone signs in again. What is the most secure fix?

Give the jobs a dedicated least-privilege role, set its Sign-in duration (--max-signin-session-duration) to up to 90 days, and sign in once with aws login --remote. The CLI then refreshes short-lived credentials for the whole session.

3. An IAM user has been signed in to the console for 9 hours and switches to a role whose maximum session duration is 12 hours. How long does the role session last?

About 3 hours. A switched role gets the role maximum or the time left in the user session, whichever is less, so assuming a role can never extend the session.

4. Engineers switch from a hub role into workload roles that allow 12-hour sessions, but they are signed out after 1 hour. What causes this?

Role chaining. When one role assumes another, the session is capped at 1 hour regardless of each role's maximum session duration, in the console, the CLI and the API.

5. Users who sign in through the IAM Identity Center access portal are signed out of the AWS account console after 1 hour. How do you give them an 8-hour working session?

Raise the permission set's Session duration (default 1 hour, maximum 12 hours) to 8 hours. IAM Identity Center reprovisions every account that uses the permission set.

6. A laptop with an active 30-day aws login session is stolen. What should the administrator do, and what limits apply?

List the principal's sessions with aws signin list-sessions and revoke them with aws signin batch-revoke-sessions. Revocation can take up to an hour and already-issued access tokens stay valid until they expire, so also remove or deny the principal's permissions in the meantime.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

Ethan: "Then it’s usually “switch roles earlier” or “raise the permission set to 12 hours”. The 90-day setting won’t help them, and now you know why."

Frequently asked questions

What is the AWS Management Console session timeout?

It depends on how you sign in. IAM users get 12 hours. A role you switch to gets its maximum session duration, from 1 to 12 hours, or whatever is left of your own session, whichever is shorter. SAML sign-ins get 15 minutes to 12 hours, and IAM Identity Center permission sets get 1 to 12 hours, with 1 hour as the default.

How do I increase the AWS console session timeout?

Raise the setting that controls your sign-in type: the role’s Maximum session duration (up to 12 hours), the SessionDuration attribute your identity provider sends (up to 12 hours), or the permission set’s Session duration in IAM Identity Center (up to 12 hours). The 12-hour IAM user console session has no setting to change.

Can I change the 12-hour console session for IAM users?

No. IAM user console sessions last 12 hours, and AWS doesn’t offer a setting to make them longer or shorter. For a shorter session, have users switch to a role with a lower maximum session duration, or move them to IAM Identity Center, where you set the duration per permission set.

Does the new 90-day sign-in duration apply to the AWS console?

No. The Sign-in duration setting added on November 23, 2026 covers OAuth sign-in sessions used by the AWS CLI’s aws login command, the AWS MCP Server and other OAuth apps. Console sessions keep their existing limits.

Is there an AWS console idle timeout?

There’s no documented idle timeout for the AWS Management Console, and no setting for one. Sessions end when their duration runs out, not after inactivity. The 20-minute idle timeout people often find belongs to Systems Manager Session Manager, which is a different tool.

Why does the AWS console log me out after 1 hour?

You’re most likely in a role session that uses the 1-hour default. That happens when you switch to a role whose maximum session duration is still 1 hour, when you chain roles (always capped at 1 hour), when your identity provider sends no SessionDuration, or when your Identity Center permission set is on its 1-hour default.

Why did switching roles shorten my console session?

A switched role gets the role’s maximum session duration or the time left in your own session, whichever is less. If a role allows 10 hours but you’ve already been signed in for 8 of your 12, the role session lasts 4 hours. You can’t extend your session by assuming a role.

What is the aws login command?

It’s an AWS CLI command, added in version 2.32.0, that signs the CLI in with your console credentials through the browser. The CLI then keeps short-lived credentials refreshed for you, so you don’t need long-term access keys on your computer.

aws login duration: how long does a session last?

By default, a sign-in session lasts 12 hours, and then you run aws login again. Since November 23, 2026, an administrator can set a Sign-in duration from 1 hour to 90 days on your IAM user or role, and aws login sessions then last that long.

How do I set the AWS sign-in duration to 90 days?

In the IAM console, open the user or role, choose Edit in the Summary section and pick a Sign-in duration up to 90 days. From the CLI, run aws iam update-role --role-name NAME --max-signin-session-duration 7776000, or aws iam update-login-profile --user-name NAME with the same option. It applies to new sessions only.

Which AWS CLI version do I need for aws login?

Version 2.32.0 or later for aws login itself. To set the new sign-in duration from the CLI, you need 2.41.1 or later, which added the --max-signin-session-duration option and the aws signin session commands. Check with aws --version.

What’s the difference between aws login and aws sso login?

aws login uses the same credentials you use for the console: root, IAM user or a role you federate into. aws sso login is for IAM Identity Center users and uses the Identity Center session settings. If your company signs you in through the AWS access portal, use aws sso login.

Why is the aws login command not found?

Either the AWS CLI is older than version 2.32.0, which gives “aws: error: argument command: Invalid choice”, or the CLI isn’t installed or on your PATH, which gives “aws: command not found”. Update to the latest AWS CLI version 2, then check aws --version.

How do I change the AWS SSO session timeout?

In IAM Identity Center, change two settings. Settings › Authentication › Session duration sets the access portal session, 8 hours by default and up to 90 days. Each permission set’s Session duration sets how long you stay in an AWS account, 1 hour by default and up to 12 hours. Both apply to new sessions.

Does aws_session_token expire?

Yes. Temporary credentials from a role last 1 hour by default and up to the role’s maximum session duration, at most 12 hours; role chaining is capped at 1 hour. With aws login or aws sso login, the CLI fetches new ones for you while your sign-in session is valid. Expired ones fail with an ExpiredToken error.

Is it safe to stay signed in to the AWS CLI for 90 days?

Safer than long-term access keys, which never expire on their own, but riskier than a short session. Anyone who copies your login cache can act as you until the session ends or is revoked. Use the shortest duration your work needs, protect your laptop, and know how to revoke a session.

How do I revoke an aws login session?

Run aws signin list-sessions --principal-arn with the user or role ARN to find the session, then aws signin batch-revoke-sessions --session-arns with its ARN. Revocation can take up to an hour, and access tokens already issued keep working until they expire. On your own computer, aws logout deletes the cached credentials.

Why does aws login say the refresh token has expired right after I sign in?

Almost always your computer’s clock is wrong. The error is AccessDeniedException on CreateOAuth2Token, “The refresh token has expired.” Sync the clock, and on WSL, resync Windows time and run wsl --shutdown, then sign in again.

Why does aws login hang after the browser opens?

Usually stale AWS cookies in the browser: the sign-in page shows 400 Bad Request, and the CLI waits up to 10 minutes for a reply that never comes. Cancel, sign in from a private window or clear AWS cookies, and check that your identity has the SignInLocalDevelopmentAccess policy.

What does “Key format is not supported” mean with aws login?

It’s a bug, not something you did. About 1 in 200 to 250 sign-ins writes a key to the login cache that the CLI can’t read back, so the next refresh fails with 7178 (AWS_ERROR_CAL_UNSUPPORTED_KEY_FORMAT). Run aws login again to get a new key.

Can I use aws login on a headless server without a browser?

Yes. Run aws login --remote. The CLI prints a sign-in URL that you open on any device with a browser, and you paste the authorization code it shows back into the terminal. With the new sign-in duration, that one sign-in can last up to 90 days.

Does the sign-in duration setting work for the root user?

No. It can’t be set on the root user or on service-linked roles. The root user can still use aws login with the default session, but you shouldn’t use root for everyday work at all.

How long is an IAM Identity Center session?

Two timers apply. The AWS access portal session defaults to 8 hours and can be set from 15 minutes to 90 days. Each permission set then gives you 1 to 12 hours in an AWS account, 1 hour by default. You’re signed out of an account when its permission set time runs out.

Why does IAM Identity Center sign me out after 10 hours?

If your identity source is AWS Managed Microsoft AD, its Kerberos tickets last a fixed 10 hours, so access portal sessions end at 10 hours even if you set 12 or more. AD Connector has the same 10-hour default, set in your own Active Directory.

Can I stay signed in to several AWS accounts at once?

Yes. Turn on multi-session in the console’s account menu, and you can be signed in to up to five identities in one browser: any mix of root, IAM users and federated roles, in the same or different accounts. Each opens in its own tab, and the setting is per browser.

Session timeout vs idle timeout: what’s the difference?

A session timeout ends a session a fixed time after sign-in, however busy you are. An idle timeout ends it after a period of no activity. The AWS console only has session timeouts; Systems Manager Session Manager is an example of an AWS tool with an idle timeout.

What is the AWS session token expiration time?

For roles, the temporary credentials last 1 hour by default, and up to the role’s maximum session duration of 12 hours when requested. Role chaining is capped at 1 hour. With aws login, the CLI refreshes short-lived credentials every 15 minutes or so while your sign-in session lasts.

Why is aws login not working?

The usual causes, in order: an AWS CLI older than 2.32.0, a missing SignInLocalDevelopmentAccess policy, stale browser cookies that make the sign-in page return 400 Bad Request, a wrong computer clock that makes the refresh token look expired, and the occasional unreadable key in the login cache. Each fix is in the errors section of this guide.

Why is aws login MFA not working?

aws login signs in through the same browser page as the console, so MFA problems are console MFA problems. Check that your phone sets its time automatically, since codes depend on the clock, and pick the right device if you have more than one registered. If the device is gone, follow our lost MFA device guide.

What does aws login error 400 Bad Request mean?

The sign-in page rejected the request, most often because of stale AWS cookies in your browser, and the CLI then waits up to 10 minutes for a reply that never comes. Cancel, open the sign-in link in a private window or clear AWS cookies, and check that your identity has the SignInLocalDevelopmentAccess policy.

aws login vs aws configure: what’s the difference?

aws configure saves a long-term access key and secret in your credentials file, and they work until someone deletes the key. aws login signs you in through the browser and keeps short-lived credentials refreshed in a cache, with no keys stored, for as long as your sign-in session lasts.

Can I use aws login with the root user?

Yes. The root user can sign in with aws login and doesn’t need the SignInLocalDevelopmentAccess policy. The new Sign-in duration setting can’t be set on root, so root sessions use the default. Better still, use an IAM user or role for daily work and keep root for the few tasks that need it.

Does aws login cost anything?

There’s no separate charge for aws login or AWS Sign-In sessions. You pay only for the AWS services your commands use.

How do I see my aws login history?

Look in AWS CloudTrail. Each token AWS Sign-In issues or renews for aws login appears as a CreateOAuth2Token event from signin.amazonaws.com, with the sign-in session ARN. Console sign-ins appear as ConsoleLogin events.

Is the AWS console free?

Yes. There’s no charge for using the AWS Management Console itself. You pay for the resources you create and use through it, and new accounts get AWS Free Tier offers and credits.

How do I turn on multi-session support in the AWS console?

Open the account menu at the top right of the console and choose Turn on multi-session, or choose Enable multi-session on console.aws.amazon.com. You can then sign in to up to five identities in one browser, each in its own tab. The setting is per browser, and the console URL gains an account-specific subdomain, so update bookmarks.

How do I get a session token in AWS?

Run aws sts get-session-token with an IAM user’s long-term credentials, usually with --serial-number and --token-code to add MFA. The credentials last 15 minutes to 36 hours for IAM users, 12 hours by default, and at most 1 hour for the root user. For everyday CLI use, aws login does this for you.

Revision note. Written November 26, 2026, three days after AWS added the configurable Sign-in duration. Console limits, CLI versions and commands are current as of this date; we’ll update the page when AWS changes console session settings or the aws login behavior. “Read the fine print,” as the old saying goes: the 90-day headline was true, it just wasn’t about the console.

Related