Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created November 7, 2013 01:42
Show Gist options
  • Save yuuichi-fujioka/7347527 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/7347527 to your computer and use it in GitHub Desktop.
This shell will deploy git-server with ssh
#!/bin/bash
# install git
apt-get install git
# create user for operate git
GIT_HOME=/srv/gitrepos
GIT_SHELL=`which git-shell`
mkdir -p ${GIT_HOME}
adduser --home ${GIT_HOME} --shell ${GIT_SHELL} git
# create things for ssh
SSH_DIR=${GIT_HOME}/.ssh
mkdir -p ${SSH_DIR}
touch ${SSH_DIR}/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment