简体   繁体   English

尽管实施了所有策略,但来自EC2实例的S3 wget给出403禁止错误

[英]S3 wget from EC2 instance gives 403 forbidden error despite all policies implemented

Please help! 请帮忙!

Last login: Wed Jul 23 00:04:41 2014 from 46.7.181.81 Could not open a connection to your authentication agent. ubuntu@ip:~$ wget https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml
--2014-07-23 00:29:12--   Resolving s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)...  Connecting to s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)| connected.

HTTP request sent, awaiting response... 403 Forbidden 2014-07-23 00:29:12 ERROR 403: Forbidden.

I have tried everything. 我尝试了一切。 Policy from IAM, bucket policy, made the file public. 来自IAM的策略,存储桶策略,使文件公开。 gave all the permissions but still i get the forbidden error. 给了所有权限,但我仍然得到禁止的错误。 I am using ec2 t2.micro instance and from command line i am using wget to get the file from my s3 bucket. 我正在使用ec2 t2.micro实例,从命令行我使用wget从我的s3存储桶中获取文件。

https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml

this is the bucket policy i used 这是我使用的存储桶策略

{
    "Version": "2008-10-17",
    "Id": "Policy1406073673060",
    "Statement": [
        {
            "Sid": "Stmt1406073666892",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::hadoopconfigfiles/*"
        }
    ]
}

and this is the IAM policy 这是IAM政策

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "*",
      "Resource": "*"
    }
  ]
}

attached the IAM policy to instance as well and restarted but no effect. 将IAM策略附加到实例并重新启动但没有效果。 Please help. 请帮忙。

BR, Sarfraz. BR,Sarfraz。

You bucket policy looks correct, so I would advise you to look at your CORS configuration and have it look somthing like this: 您的存储桶策略看起来是正确的,所以我建议您查看您的CORS配置并让它看起来像这样:

<CORSConfiguration>
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM