MOHAMED
MOHAMED

Reputation: 43518

git clone fails when uses ssh connection

I used the following command to clone a git repository

git clone ssh://[email protected]/project.git

I placed the key files id_rsa.pub and id_rsa in the folder ~/.ssh/ but I get the following error when trying to clone with a above git command.

ssh -v [email protected]
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /home/user/.ssh/config
debug1: Applying options for test.server.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to test.server.com [x.x.x.x] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa.pub type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/user/.ssh/id_rsa.pub-cert type -1
ssh_exchange_identification: Connection closed by remote host

Upvotes: 4

Views: 3102

Answers (2)

Frodon
Frodon

Reputation: 3775

You can use ssh-copy-id to send your public key to the server.

Upvotes: 1

deagh
deagh

Reputation: 2724

You have to add your local key (found in /home/user/.ssh/id_rsa.pub) on the server in /home/git/.ssh/authorized_keys

Upvotes: 1

Related Questions