简体   繁体   中英

git remote push : Permission denied (publickey,keyboard-interactive)

I have been trying to set up a staging machine to run project at home (rails application).

# 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/

All this worked fine

$git remote
imac   <== this is my remote machine

When I try to git push to this machine I get:

Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly

I know there is something about SSH ... but I don't understand what I need to do on my local and on my remote machines (Mac OS X Lion).

Can someone help?

Cheers,

Joel

NEXT QUESTION:

On my remote machine I do find my cloned biowatts.git file ... but I don't see the project files (rails app) ... how does it work?

My intent is to git push to my imac and run my app there (thin start) ???

Do I need to copy my file manually? I assumed that the git clone would copy every I needed ...

That remote machine needs to know about your ssh keys.

You need to generate a key locally (if you don't have one) and then add the public key to the remote server's ~/.ssh/authorized_keys

You can follow the GitHub tutorial on setting up keys (if you don't already have them set up).

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

Instead of Step 4. Add your SSH key to GitHub, you'll need to add your key to the authorized_keys file on the server.

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

In the future, for those of you encountering this in assembla specifically, the solution is to copy your ~/.ssh/id_rsa.pub to the assembla profile. This post gives step by step instructions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM