title: S3 wget from EC2 instance gives 403 forbidden error despite all policies implemented
body: <p>Please help!</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>I have tried everything. Policy from IAM, bucket policy, made the file public. 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.</p>
  
  <p><a href="https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml" rel="nofollow">https://s3-eu-west-1.amazonaws.com/hadoopconfigfiles/core-site.xml</a></p>
  
  <p>this is the bucket policy i used </p>
  
  <pre><code>{
      "Version": "2008-10-17",
      "Id": "Policy1406073673060",
      "Statement": [
          {
              "Sid": "Stmt1406073666892",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:*",
              "Resource": "arn:aws:s3:::hadoopconfigfiles/*"
          }
      ]
  }
  </code></pre>
  
  <p>and this is the IAM policy</p>
  
  <pre><code>{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Action": "*",
        "Resource": "*"
      }
    ]
  }
  </code></pre>
  
  <p>attached the IAM policy to instance as well and restarted but no effect. Please help.</p>
  
  <p>BR,
  Sarfraz.</p>