![](/img/trans.png)
[英]Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push
[英]git remote push : Permission denied (publickey,keyboard-interactive)
我一直在尝试设置一个临时机器来在家里运行项目(rails应用程序)。
# Remote machine connection
REPLOGIN=joel
REPADDRESS=192.168.2.100
REPLOCATION=/Users/joel/Projects/bio_watts #Repo location
REPNAME=biowatts
# Copy the repo to the server
echo "Copying the git repo to the server $REPADDRESS"
echo "repname:$REPNAME"
TEMPREP="$REPNAME.git"
echo "$TEMPREP"
git clone --bare .git $TEMPREP
scp -r $TEMPREP $REPLOGIN@$REPADDRESS:$REPLOCATION/
# Set up the origin for the project
#echo "Linking current repository to remote repository"
git remote add imac $REPLOGIN@$REPADDRESS:$REPLOCATION/$REPNAME.git/
这一切都很好
$git remote
imac <== this is my remote machine
当我尝试git推送到这台机器时,我得到:
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly
我知道有一些关于SSH的东西...但我不明白我需要在本地和远程机器上做什么(Mac OS X Lion)。
有人可以帮忙吗?
干杯,
乔尔
下一个问题:
在我的远程计算机上,我找到了我的克隆biowatts.git文件...但我没有看到项目文件(rails app)......它是如何工作的?
我的意图是git推送到我的imac并在那里运行我的应用程序(瘦启动)???
我需要手动复制我的文件吗? 我假设git clone会复制我需要的每一个......
该远程机器需要知道您的ssh密钥。
你需要在本地生成一个密钥(如果你没有),然后将公钥添加到远程服务器的~/.ssh/authorized_keys
您可以按照GitHub教程设置密钥(如果您尚未设置密钥)。
http://help.github.com/mac-set-up-git/
而不是步骤4.将SSH密钥添加到GitHub,您需要将密钥添加到服务器上的authorized_keys文件。
你的远程git服务器应该通过你的iMac的公共ssh密钥知道你的机器,并且应该有一个允许你推送(写权限)的配置。
在将来,对于那些在具体的组件中遇到此问题的人来说,解决方案是将〜/ .ssh / id_rsa.pub复制到assembla配置文件中。 这篇文章给出了一步一步的说明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.