git remote push:权限被拒绝(publickey,键盘交互)

时间:2012-01-05 15:26:40

标签: ruby-on-rails git ssh remote-server

我一直在尝试设置一台临时机来在家中运行项目(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 push to my imac并在那里运行我的应用程序(瘦启动)???

我是否需要手动复制文件?我认为git clone会复制我需要的每一个......

3 个答案:

答案 0 :(得分:1)

远程机器需要知道你的ssh密钥。

您需要在本地生成密钥(如果没有密钥),然后将公钥添加到远程服务器的~/.ssh/authorized_keys

您可以按照GitHub教程设置密钥(如果您还没有设置密钥)。

http://help.github.com/mac-set-up-git/

而不是步骤4.将SSH密钥添加到GitHub,您需要将密钥添加到服务器上的authorized_keys文件中。

答案 1 :(得分:1)

你的远程git服务器应该通过你的iMac的公共ssh密钥知道你的机器,并且应该有一个允许你推送(写权限)的配置。

答案 2 :(得分:0)

将来,对于那些专门在assembla中遇到此问题的人来说,解决方法是将〜/ .ssh / id_rsa.pub复制到assembla配置文件中。 This post gives step by step instructions.