From e65dc35e2e4ec2f6c88bdba6067d22d7f3de3ffd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jan 2016 17:31:21 +0200 Subject: Add instructions on how to setup locked down git account --- cheatsheet.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cheatsheet.txt') diff --git a/cheatsheet.txt b/cheatsheet.txt index bcb5e4c..bee3cf9 100644 --- a/cheatsheet.txt +++ b/cheatsheet.txt @@ -41,6 +41,18 @@ Setup remote repository 3. # blow the local project and do clone git clone scm.codesynthesis.com:/var/scm/proj/proj.git [name] +Setup severe git account (replace USER) + +# adduser --disabled-password --shell /usr/bin/git-shell USER +# usermod -a -G scm USER +# su -l -s /bin/bash USER +$ mkdir .ssh +$ mv /tmp/id_rsa.pub .ssh/authorized_keys +$ chown -R USER:USER .ssh +$ chmod 700 .ssh +$ chmod 600 .ssh/authorized_keys + + Delete a branch from a remote repository git push origin :experimental -- cgit v1.1