Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 down vote accepted

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .