Git Product home page Git Product logo

git-ssh-server's Introduction

git-ssh-server

A minimal GIT server.

Build instructions

git clone https://github.com/unixtastic/git-ssh-server
docker build -t 'unixtastic/git-ssh-server' .

Usage instructions

To run this first create a data directory on your docker host to hold git data, ssh authentication, and possibly git-shell-commands.

mkdir /docker_data/git

Run the container.

docker run -d -p 2222:22 -v /docker_data/git:/git unixtastic/git-ssh-server

You may substitute '2222' with any port number of your choosing.

Add users

Setup SSH:

cd /docker_data/git
mkdir .ssh
chown -R 987:987 .ssh
chmod -R 700 .ssh
touch .ssh/authorized_keys

Add user public keys to .ssh/authorized_keys just like you would do for 'normal' SSH.

touch /docker_data/git/.hushlogin to prevent login banners that can confuse git.

Setup repos

mkdir /docker_data/git/mynewproject.git
cd /docker_data/git/mynewproject.git
git --bare init
chown -R 987:987 .

Clone the repo from a client:

git clone ssh://git@myserver:2222/git/mynewproject.git

Setup git-shell-commands

mkdir /docker_data/git/git-shell-commands
chown 987:987 /docker_data/git/git-shell-commands
chmod 700 /docker_data/git/git-shell-commands

Add your commands to the above directory. You might want to start with list, which you can find under /usr/share/doc on most git client machines.

Notes

The SSH host keys are generated at the first run of each new container. This will confuse some git clients and really should be changed.

git-ssh-server's People

Contributors

javimerino avatar unixtastic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.