Configuring AWS CLI on Linux or macOS stores the credentials and defaults needed to run AWS commands without repeating the same account and region details on every invocation. A working local profile is the starting point for routine tasks such as listing S3 buckets, inspecting identities with STS, or running automation from a shell session.
The aws configure wizard writes the access key pair to ~/.aws/credentials and stores settings such as the default region and output format in ~/.aws/config. When no profile name is supplied, the wizard updates the default profile, which is the profile the CLI uses automatically unless a command or environment variable selects another one.
Current AWS guidance favors short-lived credentials where possible. The steps below focus on the classic access key workflow for aws configure; if the account uses console-based temporary credentials or IAM Identity Center, use aws login or aws configure sso instead of storing long-term keys locally.
$ aws --version aws-cli/2.34.18 Python/3.13.12 Darwin/25.3.0 source/arm64
Install the CLI first if the command is missing.
Do not configure routine CLI access with root account keys. Use a least-privilege IAM user or another approved credential source instead.
$ aws configure Tip: You can deliver temporary credentials to the AWS CLI using your AWS Console session by running the command 'aws login'. AWS Access Key ID [None]: AWS Secret Access Key [None]: Default region name [None]: Default output format [None]:
Use aws configure --profile profile-name when a separate named profile is needed instead of overwriting default.
AWS Access Key ID [None]: AKIAEXAMPLECORE00001
AWS Secret Access Key [None]: coreSecretExample0000000000000000000000001
Default region name [None]: us-west-2
Press Enter to leave the region unset when commands will always pass --region explicitly or use environment variables.
Default output format [None]: json
Common formats are json, yaml, text, and table.
$ cat ~/.aws/credentials [default] aws_access_key_id = AKIAEXAMPLECORE00001 aws_secret_access_key = coreSecretExample0000000000000000000000001
$ cat ~/.aws/config [default] region = us-west-2 output = json
Named profiles appear as [profile profile-name] in ~/.aws/config even though the credentials file still uses the bare profile name.
$ aws configure list NAME : VALUE : TYPE : LOCATION profile : <not set> : None : None access_key : ****************MPLE : shared-credentials-file : secret_key : ****************EKEY : shared-credentials-file : region : us-west-2 : config-file : ~/.aws/config
This command is the quickest way to confirm which profile, file, environment variable, or login cache the CLI is actually using.
$ aws sts get-caller-identity
{
"UserId": "AIDASAMPLEUSERID",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/PlatformOperator"
}
A successful response confirms that the key pair works and shows the active account and user or role ARN.