0

I am setting up a Git server on Ubuntu 14.04 LTS. I need the server to support both the SSH and HTTP protocols.

So far I've followed the instructions in the Git Book to get my server to support the SSH protocol.

To support the HTTP protocol, I'm hooking pushover into my existing web server. Since the web server is running as a different user, though, it wouldn't be able to write to the main repositories, which are owned by the "git" user. So I added my web server user to the "git" group, and did a chmod -R g+w /home/git and got the HTTP protocol to work. However, by doing this I inadvertently broke SSH access to the repos, since OpenSSH does not allow a user's home directory to be group-writeable.

There are a couple things I've thought of to solve this issue.

  1. Change the global SSH configuration options, either by setting a custom AuthorizedKeysFile location or by setting StrictModes no. I don't want to do either of these things because the changes affect my other non-git SSH users.
  2. Remove group write privileges from the git user's home directory, and then write a script that manually adds group write privileges to new repositories. This would probably work but it just doesn't seem like a very elegant solution.

Any suggestions for how to structure my file system to allow for group-writeable git repositories while at the same time maintaining SSH access?

2
  • How about moving the repositories out of the home directory? Jan 7, 2015 at 15:39
  • The main problem with moving the repos out of the home directory is that it messes up existing SSH checkouts that I have.
    – sffc
    Jan 7, 2015 at 22:11

0

You must log in to answer this question.

Browse other questions tagged .