Farhan Ahmad
Farhan Ahmad

Reputation: 5198

git clone asking for password (multiple users)

I have setup a VM with multiple users. My primary users is VM-User and using that account I created another user called "Joe". I have cloned a git repo by loggin into the VM-User and everything works fine.

The problem I'm having is when I try to clone the same repo by loggin into the user "Joe" it asks me for a password for the git server.

git clone [email protected]:repo.git some_folder

its shows:

[email protected]'s password: (asks me to type in a password)

I have created an ssh key for "Joe" and added it to gitosis.

Does anyone know what I'm doing wrong?

Thanks in advance :)

SSH Debug Log:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/joe/.ssh/id_rsa
debug1: Trying private key: /home/joe/.ssh/id_dsa
debug1: Trying private key: /home/joe/.ssh/id_ecdsa
debug1: Next authentication method: password

Upvotes: 3

Views: 4894

Answers (2)

Sebastian Posada
Sebastian Posada

Reputation: 89

I had the same issue. I just pressed Enter in response to Enter file in which to save the key (/c/Users/sposada/.ssh/id_rsa): and I copied the id_rsa.pub and changed the name in the server.

git is trying to get the ssh public key from /home/joe/.ssh/id_rsa but you have /home/joe/.ssh/joe

Upvotes: 1

Mark Leighton Fisher
Mark Leighton Fisher

Reputation: 5693

You don't have an authorized key set up on the cloning machine, otherwise SSH would never get to this step:

 debug1: Next authentication method: password 

I would check that I have the correct key(s) on the VM and the cloning machine.

Upvotes: 3

Related Questions