Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed git and gitosis as described here in this guide Here are the steps I took:

Server: Gentoo
Client: MAC OS X

1) git install

emerge dev-util/git

2) gitosis install

cd ~/src
git clone git://
cd gitosis
python install

3) added git user

adduser --system --shell /bin/sh --comment 'git version control' --no-user-group --home-dir /home/git git

In /etc/shadow now:


4) On local computer (Mac OS X) (local login is ipx, server login is expert)

ssh-keygen -t dsa

got 2 files:


5) Copied onto server


Added content from file ~/.ssh/ into file ~/.ssh/authorized_keys

cp ~/.ssh/ /tmp/
sudo -H -u git gitosis-init < /tmp/
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

6) Added 2 params to /etc/ssh/sshd_config

RSAAuthentication yes
PubkeyAuthentication yes

Full sshd_config:

Protocol 2
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
UsePAM yes
PrintMotd no
PrintLastLog no
Subsystem   sftp   /usr/lib64/misc/sftp-server

7) Local settings in file ~/.ssh/config:

User expert
Port 22
IdentityFile ~/.ssh/id_dsa

8) Tested:



9) Next step. There I have problem

git clone
cd gitosis-admin

SSH asked password for user git. Why ssh should allow me to login as user git? The git user doesn't have a password. The ssh key I created is for the user expert. How this should work?

Do I have to add some params to sshd_config?

share|improve this question

As a notice for anybody who finds this question in the future, I would like to point out that gitosis has been declared as deprecated by the majority of the git community and appears to be abandoned by its author.

Gitolite has become its successor and is unanimously agreed to be superior in every way, most importantly being ease of use, troubleshooting, and debugging.

share|improve this answer
Thanks for the info. – Jonathan Dumaine Apr 5 '11 at 18:56

It looks like you missed a couple steps from the guide. After setting up the ssh keys it says:

Next we will run a command that will sprinkle some magic into the home directory of the git user and put your public SSH key into the list of authorized keys.

sudo -H -u git gitosis-init < /tmp/


For good measure, let's make sure the post-update hook is set executable. I've seen it where sometimes it doesn't get set (problem with older setuptools):

sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

then you want to do the step you were having trouble with:

git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git
cd gitosis-admin
share|improve this answer
Thanks, but I did this on step 5 sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update But ssh asked a password... – user28373 Feb 25 '10 at 22:14

On step 5, you don't need to add the key to ~/.ssh/authorized_keys file yourself... the gitosis-init does that for you.

And on your client side, in the ~/.ssh/config file the settings should be:

User git
Port 22
IdentityFile ~/.ssh/id_dsa

since you want the password-less login to happen for the git user on the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.