title: Get "fatal error: Unable to locate credentials" when I'm copying file from S3 to EC2 using aws cli
body: <p>When login EC2 as ec2-user and run the following command:</p>
  
  <pre><code>aws s3 cp s3://mybucket/test/test.txt /home/ec2-user/
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>fatal error: Unable to locate credentials
  </code></pre>
  
  <p>My bucket and my EC2 are created by the same account and in the same region. Why my EC2 can't access my S3 object?</p>