vendredi 28 août 2015

SSH into EC2 and can't execute git clone command

I've ssh'd in to a new ec2 instance, which I'm setting up for our production environment, and tried to git clone a project from another ec2 instance which we are using as our development box but I get the below error.

$ git clone ubuntu@?.??.??.??6:/var/git/our-project.git our-project
Cloning into 'our-project'...
ssh: connect to host ?.??.??.??6 port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've created a public/private key pair on the production box to connect to the development box and added the public key to the dev box's authorized_keys. This is the same setup I've used on my local machine, which works. I do have a AWS security group configured which has the production ec2s public IP added to it to allow ssh inbound connections on port 22

Could the problem be that I can't ssh into a machine and perform another ssh from within it, which is what in effect the git clone command is doing? I also tried what was suggested in this answer to run the git clone command from my local machine with the following, but as you can see this gives me the same error message.

ssh ubuntu@5?.??.??.??8 'git clone ubuntu@?.??.??.??6:/var/git/our-project.git /var/www/our-project'
Cloning into '/var/www/houseofireland'...
ssh: connect to host ?.??.??.??6 port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Would be very grateful for any possible causes or solutions to this issue.




Aucun commentaire:

Enregistrer un commentaire