<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>GDAL 3.4.1, released 2021/12/27 (Ubuntu 22.04)<br>
</p>
<p>I have this file ~/.aws/credentials (configured by this command:
aws configure)</p>
<p>[default]<br>
aws_access_key_id = AKIAY.....<br>
aws_secret_access_key = qc2KcpImI/....</p>
<p>This works fine for aws CLI command to download a Landsat-8 tiff
file:</p>
<p>aws s3 cp --request-payer requester
s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF
.</p>
<p>But gdal cannot read the file?</p>
<p>gdalinfo
/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF<br>
Warning 1: HTTP response code on
<a class="moz-txt-link-freetext" href="https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF">https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF</a>:
403</p>
<p>On <a class="moz-txt-link-freetext" href="https://gdal.org/user/virtual_file_systems.html">https://gdal.org/user/virtual_file_systems.html</a>, it says:</p>
<p><span style="color: rgb(64, 64, 64); font-family: Lato,
proxima-nova, "Helvetica Neue", Arial, sans-serif;
font-size: 16px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(252, 252, 252); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">Starting with
GDAL 2.3, alternate ways of providing credentials similar to
what the "aws" command line utility or Boto3 support can be
used. If the above mentioned environment variables are not
provided, the<span> </span></span><code class="docutils literal
notranslate" style="box-sizing: border-box; font-family:
"Source Code Pro", Consolas, "Courier New",
monospace; font-size: 14.4px; white-space: normal; max-width:
100%; background: rgb(255, 255, 255); border: 1px solid rgb(225,
228, 229); padding: 2px 5px; color: black; overflow-x: auto;
font-style: normal; font-variant-ligatures: normal;
font-variant-caps: normal; font-weight: 400; letter-spacing:
normal; orphans: 2; text-align: left; text-indent: 0px;
text-transform: none; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial;"><span class="pre" style="box-sizing: border-box;">~/.aws/credentials</span></code></p>
<p><code class="docutils literal notranslate" style="box-sizing:
border-box; font-family: "Source Code Pro", Consolas,
"Courier New", monospace; font-size: 14.4px;
white-space: normal; max-width: 100%; background: rgb(255, 255,
255); border: 1px solid rgb(225, 228, 229); padding: 2px 5px;
color: black; overflow-x: auto; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><span class="pre" style="box-sizing: border-box;"><br>
</span></code></p>
<p><code class="docutils literal notranslate" style="box-sizing:
border-box; font-family: "Source Code Pro", Consolas,
"Courier New", monospace; font-size: 14.4px;
white-space: normal; max-width: 100%; background: rgb(255, 255,
255); border: 1px solid rgb(225, 228, 229); padding: 2px 5px;
color: black; overflow-x: auto; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><span class="pre" style="box-sizing: border-box;">I even tried to set
environmental variables, but it doesn't work either:</span></code></p>
<p><code class="docutils literal notranslate" style="box-sizing:
border-box; font-family: "Source Code Pro", Consolas,
"Courier New", monospace; font-size: 14.4px;
white-space: normal; max-width: 100%; background: rgb(255, 255,
255); border: 1px solid rgb(225, 228, 229); padding: 2px 5px;
color: black; overflow-x: auto; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial;"><span class="pre" style="box-sizing: border-box;">export
AWS_ACCESS_KEY_ID=AKIAY5....<br>
export AWS_SECRET_ACCESS_KEY=qc2KcpImI/....<br>
gdalinfo
/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF<br>
Warning 1: HTTP response code on
<a class="moz-txt-link-freetext" href="https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF">https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF</a>:
403<br>
ERROR 14: Access Denied<br>
gdalinfo failed - unable to open
'/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF'.<br>
<br>
</span></code></p>
<p>Thanks,<br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>