我正在尝试为我的 nginx 服务器使用日志轮换配置,该服务器用作位于 EC2 Ubuntu 实例上的反向代理机器。
我想在轮换后将这些日志存储在 S3 存储桶上,但是当我尝试配置 s3cmd 工具时,我只会收到“访问被拒绝,你确定你的密钥有 ListAllMyBuckets 权限错误”。
我很确定我的凭据在 IAM 上已正确配置,尝试了至少五个不同的凭据(甚至是根凭据),结果相同。使用具有相同凭据的 aws cli 工具列出本地计算机中的所有存储桶可以正常工作,因此让我感到困惑的是,我仅在我的 EC2 实例上没有任何访问权限。
这就是我运行的:
which s3cmd
/usr/local/bin/s3cmd
s3cmd --configure --debug
Access Key: **************
Secret Key: *******************************
Encryption password:
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0
这就是结果
...
DEBUG: ConnMan.put(): connection put back to pool (http://s3.amazonaws.com#1)
DEBUG: S3Error: 403 (Forbidden)
DEBUG: HttpHeader: x-amz-id-2: nMI8DF+............
DEBUG: HttpHeader: server: AmazonS3
DEBUG: HttpHeader: transfer-encoding: chunked
DEBUG: HttpHeader: x-amz-request-id: 5912737605BB776C
DEBUG: HttpHeader: date: Wed, 23 Apr 2014 13:16:53 GMT
DEBUG: HttpHeader: content-type: application/xml
DEBUG: ErrorXML: Code: 'AccessDenied'
DEBUG: ErrorXML: Message: 'Access Denied'
DEBUG: ErrorXML: RequestId: '5912737605BB776C'
DEBUG: ErrorXML: HostId: 'nMI8DF+............
ERROR: Test failed: 403 (AccessDenied): Access Denied
ERROR: Are you sure your keys have ListAllMyBuckets permissions?
我的 nginx 服务器前面唯一的东西是负载均衡器,但我不明白为什么它会干扰我的请求。会不会是我错过的其他东西?