gitosis asking for password

10,577

Solution 1

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.

Solution 2

Hi, I had the same problem, and I finally found a way out.

I had to follow the instructions given by many websites, but each time after

git clone git@[serveur_name]:gitosis-admin.git

It was asking password for GIT.

Resolution: I have inserted the admin public key (the one created on my client user; then imported into the server's tmp directory) inside my authorized_keys file (located in the /home/git/.ssh/ directory of the server) and it works now.

 cp authorized_keys authorized_keys.bak
 cat /tmp/id_dsa_git.pub >> authorized_keys

I found this @ http://fclose.com/b/linux/366/set-up-git-server-through-ssh-connection/

Solution 3

Make sure you're putting your public key inside your gitosis repo, and not your private one!

When you generate a keyfile, you'll get a .pub file—use that one, but put the name in your gitosis.conf without the .pub.

Solution 4

Make sure you have also added (git add) the .pub-files, and committed and pushed them properly to the repository.

Share:
10,577

Related videos on Youtube

andho
Author by

andho

15 years of Software Development and running production systems.

Updated on June 04, 2022

Comments

  • andho
    andho almost 2 years

    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

Related