I have a weird issue with cloning a git repository from amazon ec2 server. It works without problems on one of my computers running ubuntu 12.04, and on the other using 12.10 it gives me an error:
ssh: Could not resolve hostname ec2server: Name or service not known fatal: The remote end hung up unexpectedly
I like that it does not recognize my configuration file. I use the following git command to clone:
sudo git clone ec2server:/var/www/project.git
or
sudo git clone ec2xxx.compute-1.amazonaws.com:/var/www/project.git
The two configuration files are identical on both computers inside ~. / Ssh with the following contents:
Host ec2server Hostname ec2XXX.compute-1.amazonaws.com User ubuntu IdentityFile ~/.ssh/mykey.pem
If I replace ec2server with the actual address, I get the following error:
Cloning into 'project'... Permission denied (publickey). fatal: The remote end hung up unexpectedly
Thanks in advance.
git amazon-ec2 config public-key
Pio
source share