s3cmd在配置后使用时提示ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.

自己新建的ceph环境,下载了s3cmd来做客户端,使用了s3cmd –configure配置后,在使用s3cmd ls可以查看到所有的bucket,但s3cmd ls s3://xxx 具体bucket时,却提示

ERROR: S3 error: 403 (InvalidAccessKeyId): The AWS Access Key Id you provided does not exist in our records.

 

怎么回事呢??

好在s3cmd有-d调试命令来查看是怎么一回事,加-d后我们看看是哪出错了

 

DEBUG: Processing request, please wait...
DEBUG: get_hostname(bucket-default): bucket-default.s3.amazonaws.com
DEBUG: ConnMan.get(): creating new connection: http://bucket-default.s3.amazonaws.com
DEBUG: non-proxied HTTPConnection(bucket-default.s3.amazonaws.com, None)
DEBUG: format_uri(): /?delimiter=%2F
DEBUG: Sending request method_string='GET', uri=u'/?delimiter=%2F', headers={'Authorization': u'AWS CH90S4D2IEQD3K86U3C7:RmpU1kbdPIuqWE4K4yT+PvjDJrw=', 'x-amz-date': 'Mon, 06 Nov 2017 08:10:28 +0000'}, body=(0 bytes)
DEBUG: ConnMan.put(): connection put back to pool (http://bucket-default.s3.amazonaws.com#1)
DEBUG: Response:
{'data': '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message><AWSAccessKeyId>CH90S4D2IEQD3K86U3C7</AWSAccessKeyId><RequestId>A4DDC0C0101ADF22</RequestId><HostId>zUd+iRtm+Sad1baTA7nGXl+k/rQLMexWm+D1qCiVkeP2TJNUHINENd1aNcPiOfgED4jg7VT1YPE=</HostId></Error>',

 访问到s3.amazonaws.com了,这不是我要访问的地址,那要怎么该呢?

在s3cmd –help中,我们可以看到默认使用的s3配置文件放在

  Config file name. Defaults to $HOME/.s3cfg

  进去后才发现host_bucket这个地址没有变化,需要手工修改,

修改成如下

host_bucket = ip地址/%(bucket)

  当然,如果有域名时,可以使用下面这种格式

当配置完域名后才可以使用host_bucket = %(bucket)s.myceph.com这种bucket格式

  再次s3cmd ls s3://xxxx 成功

    原文作者:Believer007
    原文地址: https://www.cnblogs.com/landhu/p/7793870.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞