Farhan Ahmad Farhan Ahmad - 1 month ago 18
Git Question

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 git@0.0.0.0:repo.git some_folder


its shows:

git@0.0.0.0'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@example.com
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

Answer

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.