Can't get gitosis and ssh to play nice on cygwin
- by Noel Kennedy
I have followed this guide to setting up gitosis on a windows 2003 server via cygwin. I have now got to a point where it largely works. I can clone, pull and push.
The problem I am having is that I think I have not got the ssh bit right at all. When I connect via msysgit from machines and accounts where I have not created or uploaded ssh keys it works. Every time I clone, pull or push I get a password challenge for the 'git' user running on the server but basically I can execute git commands.
When I connect with users with an ssh key in the ~/.ssh folder, I don't get the password challange and instead I get a permissions failure:
DEBUG:gitosis.serve.main:Got command "git-upload-pack '/cris.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'teamcity@hhit24808' as 'writable' on 'cris.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cris.git', new value 'cris'
DEBUG:gitosis.access.haveAccess:Access check for 'teamcity@hhit24808' as 'writeable' on 'cris.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cris.git', new value 'cris'
DEBUG:gitosis.access.haveAccess:Access check for 'teamcity@hhit24808' as 'readonly' on 'cris.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cris.git', new value 'cris'
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
I have uploaded the public rsa key into the key_dir folder. Here is my conf file:
[gitosis]
loglevel = DEBUG
[group gitosis-admin]
writable = gitosis-admin
members = myemail@mydomain
[group cris-developers]
members = myemail@mydomain TeamCity@HHIT24808
writable = cris
If it matters, I have generated a key without a passphrase as I believe this is necessary to enable ssh for automated scripts. When I use keys with a passphrase, I get challanged for the phrase but then get the same permissions problem.
I have tried 'writable' and 'writeable' for permissions.
Help!!
Update 1:
When I try to clone a non-existant repo, I get the same error message, co-incidence?
Update 2:
Wierd, I've got one machine and one login working. It seems to be something to do with the syntax for addressing git over ssh.
This now works on one machine for one login:
git clone git@servername:cris.git
The same command fails for a user on another machine without an uploaded ssh key. But this command works (after being challanged for git@servername's password)
git clone git@servername:/home/git/repositories/cris.git
neither command works on a 2nd login whose ssh key has been uploaded