Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitosis asking for password

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

like image 641
andho Avatar asked Feb 03 '11 03:02

andho


1 Answers

Gitosis is kind of stupid — is the filename you used for the keyfile literally "johndoe"? If so, change that:

git mv keydir/johndoe keydir/johndoe.pub
git commit -m "changed key name"
git push

and try again.

Also, as Arlen Cuss points out, make sure it actually is the public key, not the private key.

like image 129
ebneter Avatar answered Sep 28 '22 02:09

ebneter