Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git keeps asking for password

Tags:

git

gitosis

I've searched and searched, for what seems like hours, for a solution to this problem and nothing I've tried works. Let me preface all this by saying that while I've used *nix before, I'm pretty much a noob so I'm sure I missed a step in the setup of Git somewhere.

I set up a Ubuntu box on the network at work to host our new Git repo. The box is running Git, Gitosis, and also ViewGit. Everything seems to be set up correctly, and I can view the repo I've added inside of ViewGit. The problem is when I go to clone the repo via TortoiseGit in Windows. When I type in the address of "[email protected]:/home/git/Plugins/.git/" it automatically asks for the password for the "git" user on the linux box. I can change this address from "git@" to any other username on the system and it will also ask for the password for that user. In any case, entering the password for that user continues the clone of the repo to the local system. Also branching, puts, and pulls will also ask for a password, and if entered everything functions properly.

I've created the RSA pub file on the windows boxes I've tried this on (via the git bash) and stored them in the keydir folder of gitosis, as well as adding the users gitosis.conf file (the name of the rsa file minus the .pub). I've also modified my sshd_config file to include "AllowUsers git" and also my username on the system. I'm at a loss, doesn't seem like a good idea to give everyone who I want to have access to this repository the server IP address, a username, and then the password to that username just so they can download some code. Thanks for the help!

like image 406
user64718 Avatar asked Nov 05 '22 11:11

user64718


1 Answers

I had the same problem recently: I could clone/push to my gitosis-managed repo from Cygwin, but TortoiseGit kept asking for the password of the git user ([email protected]).

Finally I could make it work by reinstalling TortoiseGit (I selected the Plink option at install time), then on the TortoiseGit settings go to Network > SSH Client and change the value to your Cygwin ssh binary (ie. C:\cygwin\bin\ssh.exe).

By changing this I was able to do all the operations from TortoiseGit, and I'm asked for the password the SSH key which I defined on Cygwin.

Also, check that your gitosis.conf contains the public keys which are visible to Cygwin, removing the ".pub" extension: if my Cygwin install shows that I'm myuser@myhost, the associated entry on gitosis.conf should be myuser@myhost and the file with the public key should be on keydir/[email protected]

like image 193
Denis Fuenzalida Avatar answered Nov 14 '22 20:11

Denis Fuenzalida