development:vc:gitsrv
This is an old revision of the document!
Git Server
Did setup a Git server on (MX) Linux, which can be used via SSH as user “git”.
- install packages
gitandopenssh; - create a system user “git”:
sudo adduser --system --home /home/git --shell /usr/bin/git-shell --group git
- change into it's home directory and run a shell as user “git” (
cd /home/git && sudo -u git bash); - setup SSH directory:
mkdir .ssh && chmod 0700 .ssh touch .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys
- append public key of each potential client somehow to
.ssh/authorized_keys, for example by:cat /from/somehow/id_rsa.pub >> .ssh/authorized_keys
- (optional) provide a shell script
~/git-shell-commands/no-interactive-loginfor testing authentication (test from extern with:ssh git@gitsrvorssh git);
Finally init an “example” project (as user “git”, see above)
mkdir ~/example.git git init --bare ~/example.git
and push something in, may be a bare “example” repository located on another network host:
git clone --mirror file:///home/repos/example example.git cd example.git git push --mirror git@gitsrv:example.git
development/vc/gitsrv.1789584502.txt.gz · Last modified: by Ralf Hoppe
