`An error occurred (InvalidToken) when calling the ListBuckets operation: The provided token is malformed or otherwise invalid.` w/`aws s3 ls`

梦想的初衷 提交于 2020-01-04 01:56:37

问题


I successfully authenticate with 2 factor but when using aws s3 ls I keep getting

An error occurred (InvalidToken) when calling the ListBuckets operation: The provided token is malformed or otherwise invalid.

And I do have admin rights.


回答1:


Issue was that I wasn't passing the --region in. e.g. aws s3 --region us-gov-west-1 ls. I suppose this could be set with an ENV variable too. That error message is a candidate for improvement.




回答2:


run aws configure 1. you may leave access key and access key id blank if you have an IAM role attached 2. set value for 'region' Now you will be able to successfully run 'aws s3 ls'

Else run 'aws s3 ls --region '



来源:https://stackoverflow.com/questions/54837248/an-error-occurred-invalidtoken-when-calling-the-listbuckets-operation-the-pr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!