Wednesday, April 3, 2019

s3cmd ERROR: Test failed: 400 (InvalidToken): The provided token is malformed or otherwise invalid

If you are trying to configure your AWS s3 bucket in s3cmd and you get Test Failed Error 400 although you have used correct secret and access keys. Here is solution for you.

You need to export both keys on terminal before configuring them.

Run these commands :
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE



export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY


Now configure
s3cmd --configure

You will not get the error while testing credentials.

2 comments: