0

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?

Gio Borje
  • 149
  • 3
  • 10

1 Answers1

0

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.

DerfK
  • 19,493
  • 2
  • 38
  • 54