DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk2 min

How to Sign In to AWS from Your Terminal with One Command

The AWS CLI command aws login starts browser-based sign-in for temporary command-line credentials. It does not launch the AWS Management Console interface.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use aws login to start AWS browser-based sign-in from your terminal and obtain temporary credentials for AWS CLI use. It requires AWS CLI version 2.32.0 or later. It does not directly open the signed-in AWS Management Console interface.

Sign in with AWS console credentials

Run:

aws login

AWS CLI opens your default browser and guides you through authentication, then returns you to the terminal. This flow is for signing in with AWS Management Console credentials so the CLI and supported SDKs can use temporary credentials; it is not a terminal command for launching the console UI. See the AWS Sign-In User Guide and the AWS CLI sign-in guide.

As an Amazon Associate I earn from qualifying purchases.

Check access requirements

  • Install AWS CLI version 2.32.0 or later.
  • You must be able to sign in to the AWS Management Console as a root user, IAM user, or through IAM federation.
  • IAM users, roles, or groups need the SignInLocalDevelopmentAccess managed policy. Root users do not need this policy.

Choose a profile or authenticate remotely

To save the sign-in under a named profile, use:

aws login --profile my-dev-profile

If the terminal device cannot open a browser, run aws login --remote. Complete sign-in in a browser on another device, then enter the authorization code in the CLI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Know when the session ends

The sign-in session is valid for up to 12 hours, subject to the IAM principal’s configured session duration. During an active session, the CLI and supported SDKs refresh cached credentials. When the session expires, authenticate again. To remove cached credentials, run aws logout; to clear only one profile, run aws logout --profile my-dev-profile.

Use IAM Identity Center instead

If your organization uses IAM Identity Center, configure and sign in with an SSO profile rather than using aws login:

aws configure sso
aws sso login --profile my-profile

During configuration, provide the organization’s SSO start URL or issuer URL and the Region hosting its Identity Center directory. The CLI opens a browser for authorization. AWS CLI 2.22.0 and later uses PKCE by default for this flow; add --use-device-code to use device authorization instead. After sign-in, the profile’s cached session is used to obtain credentials for the role assigned to you. If those credentials expire, you may need to sign in again. Read AWS’s IAM Identity Center CLI configuration guide.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

CloudShell is not a local terminal sign-in command

CloudShell is a browser-based shell launched from an already signed-in AWS Management Console. AWS’s getting-started steps have you sign in to the console, choose a Region, and launch CloudShell from the console interface. It is a separate environment choice, not a command that opens the console from your local terminal. See the AWS CloudShell getting-started guide.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.