title: Clone (private) Github repo to EC2
body: <p>I'm trying to clone a private Github repo to a new Amazon EC2 (Ubuntu) instance.</p>
  <p>The EC2 Instance fails to <code>git clone &lt;PATH&gt;</code> due to</p>
  <pre><code>git@github.com: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  <p>Here's my steps:</p>
  <ol>
  <li>Run <code>ssh-keygen</code> on local machine</li>
  <li>Add the newly generated public key (<code>~/.ssh/id_rsa.pub</code>) into GitHub 'SSH Keys' section</li>
  <li>Also import that public key into the EC2 'Key Pairs' dashboard</li>
  <li>Make the instance ensuring that new Key Pair is used during launch</li>
  <li>log into EC2 instance, update <code>yum</code> and <code>yum install git</code> etc</li>
  <li>Try <code>git clone &lt;PATH&gt;</code> but get permission error. Works fine on local machine...</li>
  </ol>
  <p>I'm not fully understanding how EC2 is using my Key Pair... why doesn't GitHub recognize the EC2 instance?</p>