I am running a git server on archlinux. Now I want to give a certain user access to a repository. So I created a user and set its home folder to the repository directory. Now i can checkout the repository using ssh. But the user can also ssh to the server now and see other files. How can i restrict ssh access for that user but allow him to use the repository using ssh? I tried setting the shell to /sbin/nologin but then cloning doesn't work.

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

use git-shell as the shell in /etc/passwd

http://schacon.github.com/git/git-shell.html

link|improve this answer
feedback

If you're using a new enough version of SSH (and you should), this is now a built-in feature. Here's an article on how to set it up.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.