title: ec2 scp -i mykey.pem Warning: Identity file mykey.pem not accessible: No such file or directory. Permission denied (publickey)
body: <p>Trying to upload simple a directory or file to an Amazon ec2 instance. I am using the command as follows in the standalone java ssh client and winscp:</p>
  
  <pre><code>scp -i mykey.pem ~/Downloads/zuni.jpg bitnami@ec2-184-72-159-94.compute-1.amazonaws.com:/home/bitnami/apps/magento/
  
  Warning: Identity file mykey.pem not accessible: No such file or directory.
  </code></pre>
  
  <p>Permission denied (publickey).</p>
  
  <p>I tried finding the key on the instance and couldn't, even when I saw a bunch of other .pem keys. It's not finding the .pem file. Many people have this problem of uploading to ec2.  </p>
  
  <ol>
  <li><p>How do I find mykey.pem on the instance (I tried exhaustively and found /etc/ssl/certs but my key wasn't in there).  </p></li>
  <li><p>Why isn't this working?</p></li>
  </ol>