I created an IAM user with access to only one bucket. I checked credentials and permissions via web and python boto. It works great.
Now I have a requirement to use these credentials and load a personal file from this bucket through curl .
signature="$(echo -n "GET" | openssl sha1 -hmac "f/rHQ8yCvPthxxxxxxxXxxxx" -binary | base64)" date="$(LC_ALL=C date -u +"%a, %d %b %Y %X %z")" curl -H "Host: my-bucket.s3.amazonaws.com" -H "Date: $date" -H "Authorization: AWS 'XXXAJX2NY3QXXX35XXX':$signature" -H "Content-Type: 'text/plain'" https://my-bucket.s3.amazonaws.com/path/to_file.txt
but I get the following error:
<Code> InvalidAccessKeyId The AWS passkey identifier that you specified does not exist in our records.
Please help how to upload a file using curl ? Is there something I can't see, or is it impossible with the curl command?
Thanks!
Ahsan source share