1

I am setting up git in an ubuntu 12.10 VPS. This is my first time setting up a git repository so I am just a beginner, and I'm sure I'm missing some important stuff. I have executed the following commands in my server:

# apt-get install git-core
# git config --global user.name "Roberto"
# git config --global user.name "roberto@example.com"
# apt-get install gitolite
# adduser --system --gecos 'git version control' --shell /bin/bash --group --disabled-password --home /home/git git
# su git
$ echo "PATH=$HOME/bin:$PATH" > ~/.bashrc
$ cd
$ gl-setup /tmp/roberto.pub

roberto.pub is my public certificate in my work machine. Then from that work machine, I have tried to clone the gitolite-admin repository, to manage the git server:

$ git clone git@vps:gitolite-admin.git
Cloning into 'gitolite-admin'...
git@vps's password:

Which I have not even set! Shouldn't it be asking me for roberto's password instead?

Thanks for your help!

sogeking
  • 1,216
  • 2
  • 14
  • 45

2 Answers2

2

gl-setup means old gitolite v2.
Don't. Just don't: it is so easy to get gitolite V3 and all its nice features.

Clone somewhere the latest gitolite repo:

 git clone https://github.com/sitaramc/gitolite

And carefully follow the installation instructions and setup.

 gitolite/install -to /your/path/to/gitolite/bin
 gitolite setup -pk roberto.pub
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for your advice, I have done as you said. I'm not getting any warning while configuring it. But when I try git clone ssh://git@vps/gitolite-admin.git, I am getting the error "Agent admitted failure to sign using the key". Then it's asking for git's password once again. – sogeking Oct 13 '13 at 18:59
  • @sogeking then see http://stackoverflow.com/a/2546065/6309. And make sure your private key isn't passphrase-protected: let's make this work with a simple ssh config instead of having to deal with an ssh agent. – VonC Oct 13 '13 at 19:02
  • I am not getting the last error anymore, I have edited my .ssh/config to use the public key I specified. But now, it asks me for roberto's pass and afterwards it returns the following: "fatal: 'gitolite-admin' does not appear to be a git repository" – sogeking Oct 13 '13 at 20:21
  • @sogeking an `.ssh/config` is meant to reference your *private* key, not your public one. See as an illustration http://stackoverflow.com/a/12998492/6309. – VonC Oct 13 '13 at 20:31
0

gitolite works by having a single system user, and all users of the repositories connect there.

A password prompt when using a server with gitolite usually indicates some problem with the private key on the machine you are connecting from.

A couple of pointers:

  • did the installation work? Check the .ssh/authorized_keys file for the git user on the server, does it contain your public key? If not, rerun the installation of gitolite (maybe try with the from source install as well)

  • If the key is there, check if you are able to ssh to it ssh -T git@vps (-T disables ptty allocation, sometimes ssh doesn't work with gitolite). If yes, git is unable to access the private key.

  • if you are not able to connect (or only git isn't able) check if your ssh-agent is working correctly. Also try and see if you are to connect to any user with pubkey auth that is not gitolite.

Femaref
  • 60,705
  • 7
  • 138
  • 176
  • My public key is in .ssh/authorized_keys. Anyhow, ssh -T git@vps keeps on asking me for the password. – sogeking Oct 13 '13 at 17:36
  • I can log in remotely as roberto through ssh, although not if I disable PasswordAuthentication on the server -Permission denied (publickey)-. I will try with a new pubkey. – sogeking Oct 13 '13 at 17:44
  • A new key didn't work. $ git clone git@vps:gitolite-admin Cloning into 'gitolite-admin'... roberto@vps's password: – sogeking Oct 13 '13 at 17:56