Commands that wait on slow AWS API responses, proxy hops, or large S3 transfers can still be healthy even when the next response bytes take longer than usual to arrive. Saving a larger read timeout keeps AWS CLI from aborting those long-running reads too early, while a smaller value helps stalled sessions fail faster.
The persistent setting is cli_read_timeout in the shared AWS CLI config file. aws configure set writes the value into [default] or [profile NAME] in ~/.aws/config, and aws configure get reads that saved value back locally without contacting AWS. For a single exception, --cli-read-timeout overrides the saved profile value only for the command where it is used.
AWS documents a default socket read timeout of 60 seconds, and 0 disables the read timeout so the socket blocks indefinitely. If aws configure get cli_read_timeout prints nothing, the profile is still using that default instead of an explicitly saved value, so indefinite reads belong only in shells or automation that already have their own watchdog.
$ aws configure get cli_read_timeout
No output means the profile does not have an explicit saved value and the AWS CLI default of 60 seconds is still in effect.
$ aws configure set cli_read_timeout 120
This writes
cli_read_timeout = 120
under the
[default]
section in the active shared config file.
$ aws configure get cli_read_timeout 120
This confirms the persistent profile setting rather than a one-command override.
$ aws configure set cli_read_timeout 300 --profile archive $ aws configure get cli_read_timeout --profile archive 300
This stores the value under
[profile archive]
and leaves the default profile unchanged.
$ sed -n '1,20p' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"
[default]
cli_read_timeout = 120
[profile archive]
cli_read_timeout = 300
If AWS_CONFIG_FILE is set, the command reads that override path instead of the default shared file. On Windows, the default config path is
%UserProfile%\.aws\config
.
Related: How to find the AWS CLI config file
$ aws s3 sync s3://example-archive-bucket/reports ./reports \ --profile archive \ --cli-read-timeout 900
The --cli-read-timeout flag takes precedence for that single invocation and does not rewrite the shared config file.
$ aws configure set cli_read_timeout 0 --profile archive $ aws configure get cli_read_timeout --profile archive 0
A value of 0 makes socket reads block indefinitely, which can leave interactive shells and automation waiting forever on a dead or silent connection.