I have setup a gitosis server following instructions from here. It works fine for the initial user but I have recently added a new user. Here are the steps I took.
- Created an rsa keypair using
ssh-keygen
with filename johndoe. - Then copied it to the keydir in gitosis admin repo.
- Edited the gitosis config file and added user johndoe to the list of members
- Commited the changes using
git commit -a -m "what i did"
- Pushed the changes to the server
After that I tried to check out with the new keyfile. It asks for the passphrase and when I enter it correctly, it the asks for the password for user git!!! There is not password for user git.
Now I have turned off PasswordAuthentication in sshd_config and now it says 'Permission denied (publickey). I have checked the git user's authorized_keys file and only one key is authorized inside it, i.e. the initial key for the gitosis admin.
I have also double checked the permissions on the ./gitosis-admin.git/hooks/post-update hook and it has 755
one thing that often goes wrong for windows users and isn't catched by most of the tutorials out there (since they assume you're on a linux client)
msysgit, the windows git console, is looking for your private key at /home/YOURUSERNAME/.ssh/id_rsa which at windows is (Windows 7) C:\Users\YOURUSERNAME.ssh\id_rsa
while most get it right with the folder, since its created automaticly, they miss that the file HAS TO be named "id_rsa" or it wont be used by msysgit. I didn't find a way to tell msysgit to use other keys