cant access s3 via CLI


aws s3 sync s3://fast-ai-imageclas/cifar10 s3://myvirginiabucket/fast-ai-imageclas/cifar10 fatal error: An error occurred (SignatureDoesNotMatch) when calling the ListObjectsV2 operation: The request signature we calculated does not match the signature you provided. Check your key and signing method. (base) ✘ ✝  Downloads/software/REPOS  aws configure list Name Value Type Location ---- ----- ---- -------- profile <not set> None None access_key ****************IB7X shared-credentials-file secret_key ****************IB7X shared-credentials-file region us-east-1 config-file ~/.aws/config

the user has access to S3. this is the users policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:" ], "Resource": "" } ] }

已提問 1 年前檢視次數 1222 次
3 個答案

The error above suggests that there is an issue with the signature of the request. This could indicate an incorrect access key or secret key, or a problem with the signing method being used. To resolve the issue, you can try this

  • Check that the access key and secret key being used are correct. aws configure
  • Check that the AWS CLI is configured to use the correct region. aws configure list
  • Check that the user has the necessary permissions to access the S3 bucket. You can do this by checking the policy attached to the user's IAM role, and ensuring that it grants the necessary permissions for the S3 bucket.
  • Double check that the S3 bucket name is correct and that the user has permissions to access it.
已回答 1 年前


This error is usually related with the AWS credentials, so I recommend you take the following actions:

  1. Open the ~/.aws/credentials file and check that aws_access_key_id and aws_secret_access_key values matches your IAM user credentials.
  2. Check that you have not set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, since AWS cli will use those values instead what is defined at the ~/.aws/credentials file.
  3. Finally, if the error still persists, check that the time on the system is in sync to the current time.
profile picture
已回答 1 年前

In addition to the above, specify --profile on the command to use the specific profile in your ~/.aws/credentials file. This will override any environment variables or instance profile (if running from EC2).

You can also check who you are by running aws sts get-caller-identity --profile YOUR_PROFILE_NAME.

profile pictureAWS
已回答 1 年前

您尚未登入。 登入 去張貼答案。