Server Fault is a question and answer site for system and network administrators. 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

Basically, I'm running this command: useradd -d /var/www/ -ou 10003 -g psacln -s /bin/bash Pirate

I want the user, Pirate, to only have access to /var/www/* in order to push and pull to our Git repository, /var/www/—What am I doing wrong?

share|improve this question
up vote 0 down vote accepted

If you only give access to /var/www/ to the user, then any tools they need in order to manipulate the git repository must also be somewhere in that directory... this user would not have access to /usr/bin/git.

A better way of solving your problem might be to install something like gitolite. gitolite's a bit of work to install (especially for just one user) but rather than giving each person a complete system account, everyone logs in as one specific user via the magic of ssh keys, and those git user keys are restricted to only run the gitolite server, so they cannot log in with a general shell or SFTP access.

share|improve this answer

Your Answer


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.