summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guides/cloud/git.org18
1 files changed, 12 insertions, 6 deletions
diff --git a/guides/cloud/git.org b/guides/cloud/git.org
index 109f306..11ec021 100644
--- a/guides/cloud/git.org
+++ b/guides/cloud/git.org
@@ -32,10 +32,16 @@ scan-path=/srv/git
#+end_src
* git
#+begin_src sh
-$ echo $(which git-shell) >> /etc/shells
-$ chsh git -s $(which git-shell)
-$ mkdir /srv/git
-$ chown git:www-data /srv/git
-# Each time a repository is added:
-$ git -C /srv/git/$repo config core.sharedRepository 0640
+$ sudo echo $(which git-shell) >> /etc/shells
+$ sudo adduser git --disabled-password --shell $(which git-shell)
+# Add SSH keys to ~git/.ssh/authorized_keys, prefixed with:
+# "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty "
+$ sudo addgroup git-data
+$ sudo adduser git git-data
+$ sudo adduser www-data git-data
+$ sudo mkdir /srv/git
+$ sudo chown git:git-data /srv/git
+$ sudo chmod g+s /srv/git
+# For each repo:
+$ sudo -u git git init --bare /srv/git/$repo
#+end_src