I set up git and gitolite with some help from members on this forum and using these instructions:
https://github.com/sitaramc/gitolite
In the instructions one of the requirements is:
a dedicated
useridto host the repos (in this document, we assume it is ‘git‘), with shell access ONLY by ‘su - git‘ from some otheruseridon the same server.
Are these the correct permissions shown below?
sudo chown git /home/git
sudo chmod -R 755 /home/git
…or are there more appropriate settings to provide necessary security and functionality?
Yes and no:
For
/home/git,700would work too if you want something “more secure”.But you don’t have to protect everything the same way within the
githomedir, especially the.sshdirectory.The main point is to avoid ‘
+gw‘ and ‘+ow‘ on/home/gititself: if ‘group‘ or ‘others‘ are writable, ssh won’t work (the ssh daemon will refuse to consider/home/git/.sshcontent)See “Creating SSH keys for Gerrit and Hudson” as an example of appropriate ssh protections.