better feedback when git-user may not login with ssh public key

Bug #502093 reported by N Stoker on 2010-01-01
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gitosis (Ubuntu)

Bug Description

Binary package hint: gitosis

I was following the instructions in to set up gitosis.

When trying to clone the gitosis-admin repo using

git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git

(obviously I changed the server hostname, trying localhost, the local IP address as well as the host name).

ns@node0:~$ git clone git@node0:gitosis-admin.git
Initialized empty Git repository in /home/ns/gitosis-admin/.git/
git@node0's password:

I am using Ubuntu 9.10
Release: 9.10

ns@node0:~$ apt-cache policy gitosis
  Installed: 0.2+20080825-15
  Candidate: 0.2+20080825-15
  Version table:
 *** 0.2+20080825-15 0
        500 karmic/universe Packages
        100 /var/lib/dpkg/status

Vortex Cortex (vortex-cortex) wrote :

I had this problem as well. Git uses SSH for authentication.

Check the output of the following command:

grep "AllowUsers" /etc/ssh/sshd_config

If "AllowUsers" is present in the SSH daemon config, make sure you include the "git" user.

eg: My "/etc/ssh/sshd_conf" file contained this line:
AllowUsers vortexcortex

I edited the file via this command:
gksudo gedit /etc/ssh/sshd_conf

Then, I changed the AllowUsers line to read:
AllowUsers vortexcortex git

I saved the file, quit the editor and finally restarted my SSH daemon:
sudo /etc/init.d/ssh restart

(I have also had success via removing the AllowUsers line completely)

Michael Nagel (nailor) wrote :

closing as requested

Changed in gitosis (Ubuntu):
status: New → Invalid
Michael Nagel (nailor) wrote :

sorry... wrong tab. no offense meant.

the gitosis docu is not the most comprehenive, but vortex coretex is right, the git user (i think the user is called gitosis in debian) must be able to connect to the machine via ssh. you can test via
ssh git@localhost
on the server.
you should _not_ get an error about connection problems or be asked for a password you do not know, but the message should read:
ERROR:gitosis.serve.main:Need SSH_ORIGINAL_COMMAND in environment.
you cannot connect properly because that user is not allowed to run a shell but only the gitosis program. but you should be able to connect in the first place.

Changed in gitosis (Ubuntu):
status: Invalid → Confirmed
Michael Nagel (nailor) on 2010-03-17
summary: - Password request when trying to clone gitosis-admin.git
+ better feedback when git-user may not login with ssh public key
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers