D
D
Denis2011-04-19 17:41:17
git
Denis, 2011-04-19 17:41:17

Trouble deploying gitolite

Hello. The action takes place on a freshly installed centos.
I do so:

On server side.

I install Git, create a user named git.
I clone the repository with Gitolite: git clone git://github.com/sitaramc/gitolite gitolite-source

Next:
cd gitolite-source
mkdir -p /var/www/git/data/gitolite/conf /var/www/ git/data/gitolite/hooks
src/gl-system-install /usr/local/bin /var/www/git/data/gitolite/conf /var/www/git/data/gitolite/hooks
gl-setup /home/ git/.ssh/git.pub
Now I check that everything works by downloading the configuration repository and adding a new user:

[ [email protected] ~ ]$ git clone [email protected]:gitolite-admin
Cloning into gitolite-admin…
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
[ [email protected] ~ ]$ cd gitolite-admin/
[ [email protected] gitolite-admin ]$ cp /tmp/nazarovd.pub keydir/
[ [email protected] gitolite-admin ]$ git add.
[ [email protected] gitolite-admin ]$ git commit -am "test"
[master c1bd008] test
Committer: Git Git <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email [email protected]

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 keydir/nazarovd.pub
[ [email protected] gitolite-admin ]$ git push
Counting objects: 6, done .
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 679 bytes, done.
Total 4 (delta 0), reused 0 (delta 0)
remote:
remote: ***** WARNING *****
remote: the following users (pubkey files in parens) do not appear in the config file:
remote: nazarovd(nazarovd.pub)
To [email protected]:gitolite-admin
6447e62..c1bd008 master -> master
[ [email protected] gitolite-admin ]$ cat conf/gitolite.conf
repo gitolite-admin
RW+ = id_rsa

repo testing
RW+ = @all

All right.

Now I leave on the local machine. I log in under the user nazarovd (I put his public key on the server).
Set up authorization by key:

[email protected]:~$ ssh-copy-id -i ~/.ssh/id_rsa [email protected]
[email protected]'s password:
Now try logging into the machine, with "ssh 'git @192.168.0.135'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[email protected]:~$ ssh '[email protected]'
[ [email protected] ~ ]$ logout

Trying to clone test repository:

[email protected]:~ $ git clone [email protected]:testing
Initialized empty Git repository in /home/ nazarovd/testing/.git/
fatal: 'testing' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Ving, 2011-04-20
@uscr

You can see which repositories are available to the user who logs in to gitolite. This way
ssh [email protected] info
, the command should display a list of repositories with rights to them.
It confuses me that the user nazarovd is not found in your conf/gitolite.conf. Probably because of this, the @all special group does not contain it. More precisely, when this expression is expanded, there is no nazarovd user in it.
Try this: And one more thing: you should not install keys on the server manually (via ssh-copy-id). Everything must be done through gitolite-admin/keydir and gitolite-admin/conf/gitolite.conf. In the first folder, put the public key, in the config, write the username that matches the name of the key before .pub
repo gitolite-admin
RW+ = id_rsa
repo testing
RW+ = nazarovd
RW+ = @all

The fact is that gitolite does not just add keys to .ssh/authorized_keys, but writes a command there, which then authorizes in gitolite.
It looks like this in authorized_keys
command="/usr/local/bin/gl-auth-command username",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa дальше пошел ключ

P
plagi, 2011-04-20
@plagi

try using gitorious

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question