title: Using scp to copy a file to Amazon EC2 (Ubuntu) instance?
body: <p>I cd to the file in my local computer, which contains the filkekey.pem. Then I use the code</p>
  <pre><code>scp -i file_key.pem part.txt ubuntu@ec2-54-149-103-26.us-west-2.compute.amazonaws.com:
  </code></pre>
  <p>It returns:</p>
  <pre><code>Warning: Identity file_key.pem not accessible: No such file or directory.
  Permission denied (publickey).
  lost connection
  </code></pre>
  <p>How could I deal with this situation?</p>
  <hr />
  <h3>Solved</h3>
  <p>I should log out the EC2, then doing the copy work.</p>