official link: https://github.com/res0nat0r/gitosis
usually "git" user is created with following command before this installation. but you can use any other name for the user. e.g. "git2".
1. gitosis requires python tools, so need install it first
$ apt-get install python-setuptools
2. then clone the gitosis repo
$ git clone https://github.com/res0nat0r/gitosis.git gitosis
3. install gitosis (installs a couple of executables that Gitosis will use.)
$ cd gitosis
$ sudo python setup.py install
4.Gitosis wants to put its repositories under /home/git, which is fine. But if you have already set
5.remove the current authorized_keys, re-add the keys later, and let Gitosis control the authorized_keys
6. Next you need to turn your shell back on for the 'git' user, if you changed it to the git-shell command. People still won't be able to log in, but Gitosis will control that for you. So, let's change this line in your /etc/passwd file
7.initialize gitosis: (if you want to use anoterh user id instead of git, you need change -u param). You do this by running the gitosis-init command with your personal public key. If your public key isn’t on the server,you’ll have to copy it there(/tmp/id_rsa.pub). This lets the user with that key modify the main Git repository that controls the Gitosis setup.
$ sudo -H -u git gitosis-init < /tmp/id_dsa.pub
Initialized empty Git repository in /opt/git/gitosis-admin.git/
Reinitialized existing Git repository in /opt/git/gitosis-admin.git/
8.verifying the ssh connection to the server with the user git(via your pub key).
$ ssh git@gitserver
usually "git" user is created with following command before this installation. but you can use any other name for the user. e.g. "git2".
sudo adduser \
--system \
--shell /bin/bash \
--gecos ‘User for managing of git version control’ \
--group \
--disabled-password \
--home /home/git \
git
You can change the home directory.1. gitosis requires python tools, so need install it first
$ apt-get install python-setuptools
2. then clone the gitosis repo
$ git clone https://github.com/res0nat0r/gitosis.git gitosis
3. install gitosis (installs a couple of executables that Gitosis will use.)
$ cd gitosis
$ sudo python setup.py install
4.Gitosis wants to put its repositories under /home/git, which is fine. But if you have already set
up your repositories in /opt/git, so instead of reconfiguring everything, you can create a symlink:
$ ln -s /opt/git /home/git/repositories
5.remove the current authorized_keys, re-add the keys later, and let Gitosis control the authorized_keys
file automatically.
$ mv /home/git/.ssh/authorized_keys /home/git/.ssh/ak.bak
6. Next you need to turn your shell back on for the 'git' user, if you changed it to the git-shell command. People still won't be able to log in, but Gitosis will control that for you. So, let's change this line in your /etc/passwd file
git:x:1000:1000::/home/git:/bin/bash
7.initialize gitosis: (if you want to use anoterh user id instead of git, you need change -u param). You do this by running the gitosis-init command with your personal public key. If your public key isn’t on the server,you’ll have to copy it there(/tmp/id_rsa.pub). This lets the user with that key modify the main Git repository that controls the Gitosis setup.
$ sudo -H -u git gitosis-init < /tmp/id_dsa.pub
Initialized empty Git repository in /opt/git/gitosis-admin.git/
Reinitialized existing Git repository in /opt/git/gitosis-admin.git/
8.verifying the ssh connection to the server with the user git(via your pub key).
$ ssh git@gitserver
ERROR:gitosis.serve.main:Need SSH_ORIGINAL_COMMAND in environment.
Connection to <server> closed.
this means Gitosis recognized you but shut you out because you’re not trying to do any Git commands.
9. from now on, you can manage users/repos by editing gitosis.conf and public key files in keydir folder.
- add user key files to keydir;
- update gitosis.conf to add team and team members and also permissions.
Connection to <server> closed.
this means Gitosis recognized you but shut you out because you’re not trying to do any Git commands.
9. from now on, you can manage users/repos by editing gitosis.conf and public key files in keydir folder.
- add user key files to keydir;
- update gitosis.conf to add team and team members and also permissions.
[group myteam] members = uname1 uname2 writable = myproject
---output of python setup.py install---
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating gitosis.egg-info
writing requirements to gitosis.egg-info/requires.txt
writing gitosis.egg-info/PKG-INFO
writing top-level names to gitosis.egg-info/top_level.txt
writing dependency_links to gitosis.egg-info/dependency_links.txt
writing entry points to gitosis.egg-info/entry_points.txt
writing manifest file 'gitosis.egg-info/SOURCES.txt'
reading manifest file 'gitosis.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'gitosis.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/gitosis
copying gitosis/init.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/access.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/serve.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/util.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/gitweb.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/mirror.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/__init__.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/app.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/run_hook.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/ssh.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/gitdaemon.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/snagit.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/repository.py -> build/lib.linux-x86_64-2.7/gitosis
copying gitosis/group.py -> build/lib.linux-x86_64-2.7/gitosis
creating build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_mirror.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_run_hook.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_group.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/util.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_ssh.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_repository.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/__init__.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_init.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_serve.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_gitdaemon.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_access.py -> build/lib.linux-x86_64-2.7/gitosis/test
copying gitosis/test/test_gitweb.py -> build/lib.linux-x86_64-2.7/gitosis/test
creating build/lib.linux-x86_64-2.7/gitosis/templates
copying gitosis/templates/__init__.py -> build/lib.linux-x86_64-2.7/gitosis/templates
creating build/lib.linux-x86_64-2.7/gitosis/templates/admin
creating build/lib.linux-x86_64-2.7/gitosis/templates/admin/hooks
copying gitosis/templates/admin/hooks/post-update -> build/lib.linux-x86_64-2.7/gitosis/templates/admin/hooks
creating build/lib.linux-x86_64-2.7/gitosis/templates/default
creating build/lib.linux-x86_64-2.7/gitosis/templates/default/hooks
copying gitosis/templates/default/hooks/post-receive -> build/lib.linux-x86_64-2.7/gitosis/templates/default/hooks
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/init.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/access.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/serve.py -> build/bdist.linux-x86_64/egg/gitosis
creating build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_mirror.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_run_hook.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_group.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/util.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_ssh.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_repository.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/__init__.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_init.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_serve.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_gitdaemon.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_access.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/test/test_gitweb.py -> build/bdist.linux-x86_64/egg/gitosis/test
copying build/lib.linux-x86_64-2.7/gitosis/util.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/gitweb.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/mirror.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/__init__.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/app.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/run_hook.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/ssh.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/gitdaemon.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/snagit.py -> build/bdist.linux-x86_64/egg/gitosis
creating build/bdist.linux-x86_64/egg/gitosis/templates
creating build/bdist.linux-x86_64/egg/gitosis/templates/admin
creating build/bdist.linux-x86_64/egg/gitosis/templates/admin/hooks
copying build/lib.linux-x86_64-2.7/gitosis/templates/admin/hooks/post-update -> build/bdist.linux-x86_64/egg/gitosis/templates/admin/hooks
copying build/lib.linux-x86_64-2.7/gitosis/templates/__init__.py -> build/bdist.linux-x86_64/egg/gitosis/templates
creating build/bdist.linux-x86_64/egg/gitosis/templates/default
creating build/bdist.linux-x86_64/egg/gitosis/templates/default/hooks
copying build/lib.linux-x86_64-2.7/gitosis/templates/default/hooks/post-receive -> build/bdist.linux-x86_64/egg/gitosis/templates/default/hooks
copying build/lib.linux-x86_64-2.7/gitosis/repository.py -> build/bdist.linux-x86_64/egg/gitosis
copying build/lib.linux-x86_64-2.7/gitosis/group.py -> build/bdist.linux-x86_64/egg/gitosis
byte-compiling build/bdist.linux-x86_64/egg/gitosis/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/access.py to access.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/serve.py to serve.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_mirror.py to test_mirror.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_run_hook.py to test_run_hook.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_group.py to test_group.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/util.py to util.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_ssh.py to test_ssh.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_repository.py to test_repository.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_init.py to test_init.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_serve.py to test_serve.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_gitdaemon.py to test_gitdaemon.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_access.py to test_access.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/test/test_gitweb.py to test_gitweb.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/util.py to util.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/gitweb.py to gitweb.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/mirror.py to mirror.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/app.py to app.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/run_hook.py to run_hook.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/ssh.py to ssh.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/gitdaemon.py to gitdaemon.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/snagit.py to snagit.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/templates/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/repository.py to repository.pyc
byte-compiling build/bdist.linux-x86_64/egg/gitosis/group.py to group.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gitosis.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating dist
creating 'dist/gitosis-0.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing gitosis-0.2-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg
Extracting gitosis-0.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding gitosis 0.2 to easy-install.pth file
Installing gitosis-init script to /usr/local/bin
Installing gitosis-run-hook script to /usr/local/bin
Installing gitosis-serve script to /usr/local/bin
Installed /usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg
Processing dependencies for gitosis==0.2
Searching for distribute==0.6.28dev-r0
Best match: distribute 0.6.28dev-r0
Adding distribute 0.6.28dev-r0 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for gitosis==0.2
-----
No comments:
Post a Comment