从EC2的机器访问被拒绝s3cmd被拒、机器、s3cmd

2023-09-11 08:53:47 作者:怂到你怀里

我试图用一个日志轮换配置,我使用反向代理机器位于一个EC2实例的Ubuntu我的nginx服务器。

I'm trying to use a log rotation configuration for my nginx server that I'm using as a reverse proxy machine located on an EC2 Ubuntu instance.

我要存储在S3存储这些日志旋转后,但我只获得访问被拒绝,你肯定键有ListAllMyBuckets权限错误当我试图配置s3cmd工具。

I want to store those logs on a S3 bucket after a rotation but I'm only getting "access denied, are you sure you keys have ListAllMyBuckets permissions errors" when I'm trying to configure s3cmd tools.

我是pretty的肯定,我的凭据是在IAM正确配置,尝试至少有五种不同的凭据(甚至根本CRED)具有相同的结果。它工作正常,从我的本地计算机AWS CLI工具使用相同的凭据列表我所有的桶,因此让我为难,我没有只是我的EC2实例的任何访问。

I'm pretty sure that my credentials is correctly configured at IAM, tried at least five different credentials (even the root cred) with the same result. It works fine to list all of my buckets from my local computer with aws cli tools with the same credentials so it puzzles me that I don't have any access just on my EC2 instance.

这是我所运行:

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服务器前端的唯一事情是一个负载均衡器,但我不明白为什么它会干扰我的要求。 难道是别的东西,我错过了?

The only thing that is in front of my nginx server is a load balancer, but I can't see why it could interfere with my request. Could it be something else that I've missed?

推荐答案

我发现我的问题的解决方案通过删除所有安装s3cmd的。然后确信,apt-get的是最新的,并从安装它易于得到了。我的配置(同前)后,它的工作就好了!

I found out a solution for my problems by deleting all installation of s3cmd. Then made sure that apt-get was up to date and installing it from apt-get again. After my configuration (the same as before) it worked out just fine!