I have some git repositories running on my server and I would like to give a friend read/write access to one. That’s simple: I add him as a user, give him SSH access, and change the permissions to the repository folder.
Everything works fine; I’m able to clone the git repository using Xcode and change things (ssh://www.example.com/repo.git). However, I do not want him to have command line access. If I recall correctly, Github does not give command line access to those who SSH in.
I’m using Snow Leopard Server. Is this more of a server issue or a git issue? Do you have any idea where to begin? Setting the user’s Login Shell to none (as opposed to /bin/bash) cuts off access to everything.
Using Git server software is a fine idea, but it’s not necessary if you’d rather stick with vanilla Git.
The
git-shelltool that comes with Git can help you prevent your users from gaining shell access. In short, you can set it as your users’ login shell (replacing bash, csh, or similar). They’ll be able to run the standard Git commands, but nothing else.See Setting Up the Server in Pro Git for instructions.