2

I tried to install git + gitolite following this manual - using root instalation from server. I just do not understand if new gitolite users have to have their user accounts?. When I add tester.pub key into keydir folder and configure access to some repository, git always ask for a password and do not allow me to clone anything

git clone tester@myserver.com:testrepo
Initialized empty Git repository in /home/testuser/git/testrepo/.git/
testuser@myserver.com's password:
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly

I don't believe that create system account (adduser testuser) is neccessarry because gitolite should be installable and configurable even without root access onto server.

So could anybody please show me what I have misunderstood?

Thank you very much.


EDIT:

Well... I reinstall gitolite using client instalation transcript. Now adding and pushing new pub keys successfully changes ~/.ssh/authorized_keys for my git user on server. So it seems better than my first try. But I still can not clone any repozitory from another place. When I try to add pub key + edit config for my windows PC with msysgit, then try

$ git clone git@server.com:project.git
cloning into project...
Fatal ERROR: unable to authenticate
Fatal: the remote end hung up unexpectedly

On other hand when try another linux, it still request for password.

# git clone git@server.com:project.git
Cloning into project...
git@server.com's password: 

Even when I provide password for git user:

fatal: 'project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

This was probably caused by broaken system account.

Now I really dont know what to do - should I create somehow .ssh/config on each client to make it work?

Now I am starting to be little bit annoyed and upset and I will probably remove all and try mercurial:-D Except someone could help me:) Thank you.

Zap
  • 259
  • 1
  • 3
  • 10

3 Answers3

5

Yes thats the problem... me too faced the same.. i created the public key using puttygen ssh2-rsa format gitolite does not accept this. You need to convert to openssh

ssh-keygen -i -f yourname.pub > yourname_openssh.pub

Now use this converted public key

arulraj.net
  • 4,579
  • 3
  • 36
  • 37
3

There is no 'keydata' folder, only 'keydir' and 'conf' (as mentioned in the documentation).

If you have cloned locally the gitolite-admin repo (git clone gitolite@server:gitolite-admin), you need to:

  • add your new public key named after the user in the keydir repo: username.pub
  • add that same username in one of the user groups in conf/gitolite.conf
  • push back the new modifications to the gitolite server (there is a special hook on the gitolite-admin repo which will add the new public key to the ~/.ssh/authorized_keys file).
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank for your reply. I did all of these steps, but it still ask me for password. Am I suppose to edit those *hooks*? *You have right with keydir, I wrote wrong dir name:) - corrected in question* – Zap Apr 11 '11 at 10:41
  • 1
    @Zap: no hook edits necessary ;) If it asks for any password, then the public key must have *not* been added to the `~/.ssh/authorized_keys` file correctly. That happens when the `gitolite-admin` is pushed using the wrong account (that is one which hasn't full write right on `gitolite-admin`). What exact message do you see when pushing back a modified `gitolite-admin` repo? – VonC Apr 11 '11 at 11:23
  • I think, push works without problems. Message is `Counting objects: 7, done.` `Delta compression using up to 4 threads.` `Compressing objects: 100% (3/3), done.` `Writing objects: 100% (4/4), 344 bytes, done.` `Total 4 (delta 1), reused 0 (delta 0)` `To git@server.com:gitolite-admin` ` be99f7e..5892732 master -> master` I will probably try to reinstall gitolite using another install method and see if it will help – Zap Apr 11 '11 at 15:40
  • @Zap: ok. I recommend the "from client" method (http://stackoverflow.com/questions/5041067/gitolite-git-clone-error/5041898#5041898) – VonC Apr 11 '11 at 15:54
  • @Zap: not at this stage, considering no hook edit should be required. – VonC Apr 12 '11 at 18:28
  • Well, I made some experiments - it seems that was a problem with weird linux account - I created fresh one and it **works**. It means I can clone, commit and push from linux. But problem with windows and msysgit still persists :-/ I copied pub key directly through my network disk to exclude mistakes, but still `Fatal ERROR: unable to authenticate` But it it will be probably problem in msysgit/SSH key gen there rather than gitolite – Zap Apr 12 '11 at 19:38
  • @Zap: did you generate your public/private key with `ssh-keygen -t rsa` within a bash session, with `$HOME` correctly set? – VonC Apr 12 '11 at 21:09
  • @VonC probably. `$ echo $HOME` = /c/Users/zap. With `ssh-keygen -t rsa` keys are created in folder `C:\Users\zap\.ssh\ ` and are listed in bash using `ls ~/.ssh` – Zap Apr 13 '11 at 05:06
1

I solved msysgit problem.

  1. I reinsall msysgit and use OPENSSH instead of PUTTY (it is recommended in install manual of gitolite - but I had msysgit installed before)
  2. when generating ssh-key, it must have default name id_rsa otherwise it did not work for me

Because I always had custom name for key, I can not say if step 1 is neccessary and I won't try it again:) Now I can clone/commit/push - finally.

Special thanx to VonC for his patience

Zap
  • 259
  • 1
  • 3
  • 10