我可以成功连接到我的EC2实例的SSH:
ssh -i amazon_ec2_123.pem ubuntu@xx.xx.xx.xxx
其中xx.xx.xx.xxx
是我的弹性IP地址。 然后,我创建了一个文件夹中有名为my_project.git
跑git init --bare
在里面。
然后,我这样做:
cat ~/.ssh/id_dsa.pub | ssh -i amazon_ec2_123.pem ubuntu@xx.xx.xx.xxx "cat >> .ssh/authorized_keys"
在我从我做这个项目源目录的本地机器:
git remote add ec2 ssh://ubuntu@xx.xx.xx.xxx:/home/ubuntu/my_project.git
然而,当我试图推到回购,我得到了错误:
ssh: Could not resolve hostname xx.xx.xx.xxx:: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我做了什么错?