我有一個奇怪的問題克隆從亞馬遜ec2服務器的git存儲庫。它的工作原理沒有上運行Ubuntu 12.04我的一臺計算機的任何問題,而在使用12.10另一個它給了我一個錯誤:.ssh配置與亞馬遜ec2和git
ssh: Could not resolve hostname ec2server: Name or service not known
fatal: The remote end hung up unexpectedly
它就像它不承認我的配置文件。我用下面的git命令來克隆:
sudo git clone ec2server:/var/www/project.git
或
sudo git clone ec2xxx.compute-1.amazonaws.com:/var/www/project.git
兩個配置文件是在兩臺計算機上是相同的,在〜/ SSH具有以下內容:
Host ec2server
Hostname ec2XXX.compute-1.amazonaws.com
User ubuntu
IdentityFile ~/.ssh/mykey.pem
如果我用實際地址替換ec2server,會出現以下錯誤:
Cloning into 'project'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
在此先感謝。
聽起來不錯,它適合你,所以+1。我的回答不夠具體。 – VonC