Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitolite not updating authorized_keys file

I have recently installed Gitolite in a Cygwin environment using SSH keys and everything else.

I successfully installed Gitolite and had access to the gitolite-admin repository, configured and put the new keys. When I committed and pushed, everything was fine until I noticed that I can't access the new repositories or gitolite-admin repository again ...

I then entered my server via ssh and noticed that gitolite deleted all of the public keys in authorized_keys except for my default SSH key I configured with SSH.

I checked if the hooks are propagating and everything looks fine - Gitolite created the new repositories and compiled the new gitolite.conf

I don't know what i missed - something is wrong but I don't have an idea what it is.

The last I saw is that the file ~/.gitolite/src/sshkeys-lint manage the authorized_keys files but i dont understand the shell script language very well.

like image 491
Rafael Avatar asked Sep 23 '11 13:09

Rafael


1 Answers

When you commit, are you getting the following error in the console(of the machine where from you are commiting)??

remote: FIND: Parameter format not correct 
remote: FIND: Parameter format not correct 

If yes then the problem is the find.exe.

Windows has a find.exe in its \windows\system32 folder and cygwin has its own find.exe. Usually \windows\system32 comes first in the environment variable 'path'.

Gitolite uses 'find' in its scripts, but unfortunately the find.exe from windows rather than from cywin gets executed.

Now to fix the problem, go to the environment variables tab and add bin directory of cygwin before system32.

After this you wont face the issue of "authorized_keys file getting cleared on a commit" again.

I have gitolite working on windows server 2008 machine with mirroring working fine. (I have configured this as a slave and the master is a centOs machine.) More info, As you have installed sshd as a windows service, the cygwin path would be given lesser proirity over windows path will kick in.

like image 153
manoj Avatar answered Oct 09 '22 13:10

manoj