Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you only give access to /var/www/website.com/ 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

 
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.