title: .ssh config with amazon ec2 and git
body: <p>I have a strange problem with cloning a git repository from an amazon ec2 server. It works without any problems on one of my computers running ubuntu 12.04, while on another one using 12.10 it gives me an error: </p>
  
  <pre><code>ssh: Could not resolve hostname ec2server: Name or service not known  
  fatal: The remote end hung up unexpectedly
  </code></pre>
  
  <p>It's like it is not recognizing my config file. I use the following git command to clone : </p>
  
  <pre><code>sudo git clone ec2server:/var/www/project.git
  </code></pre>
  
  <p>or</p>
  
  <pre><code>sudo git clone ec2xxx.compute-1.amazonaws.com:/var/www/project.git
  </code></pre>
  
  <p>The two config files are identical on both computers, inside the ~./ssh with the following content:</p>
  
  <pre><code>Host ec2server
     Hostname ec2XXX.compute-1.amazonaws.com
     User ubuntu
     IdentityFile ~/.ssh/mykey.pem
  </code></pre>
  
  <p>If I substitute the ec2server with the actual address I get the following error: </p>
  
  <pre><code>Cloning into 'project'...
  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly
  </code></pre>
  
  <p>Thanks in advance.</p>