title: what permission for the ec2 key is good
body: <p>I got a key.pem file and the permission was 664. I used </p>
  
  <pre><code>ssh -i key.pem xxx.xxx.xxx.xxx -l ec2-user 
  </code></pre>
  
  <p>to login to the ec2 instance. 
  But an error returned:</p>
  
  <pre><code>Permissions 0664 for '/path/to/key.pem' are too open.
  It is required that your private key files are NOT accessible by others.
  This private key will be ignored.
  </code></pre>
  
  <p>Then I tried 400, it gave me </p>
  
  <pre><code>Permission denied (publickey).
  </code></pre>
  
  <p>What permission of the key.pem should be set in order to ssh to the ec2?</p>
  
  <p>Thx in advance :)</p>