one can force a key-based SSH connection to execute the given command and no other.

Is it possible through this mechanism (or another) to give someone a limited SSH access to a given git repository, allowing that person to git clone user@server:myrepo.git, push or pull, but nothing else?

Security note: when restricting access with authorized_keys, you should also use the options: no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-user-rc

  • 3
    Look at gitolite which manages these details for you. – wurtel Feb 19 '15 at 15:24
  • Perhaps you want to use chroot for this ssh user. – webKnjaZ Feb 19 '15 at 16:17
  • install git-shell (git-sh on Debian) and change the shell for the user to git-shell. – Darek Feb 19 '15 at 16:56
  • @Dārayavahuštdi is this a guaranteed secure shell? Meaning that this user cannot escape from it or do anything else on the system? – Totor Feb 19 '15 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.