Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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