Git server protection

I am installing git server on top of ssh as

http://blog.commonthread.com/post/1034988660/setting-up-a-git-server

However, I can still access the server via ssh and see all the folders on the server. How do you usually protect the server so that the git user cannot exit the home directory and possibly damage it? I read something about chroot or prison. Or set permissions for the home directory to 700. I would like to know the easiest way to achieve some security and details on how to do this. This is on a Centos Linux server.

Is there a way to deny access to the command line while still allowing the user to press / exit git?

+4
source share
2 answers

You must install the git-shell user git-shell . From the docs (in fact, almost the entire manual page):

This is intended to be used as an login shell for SSH accounts that you want to limit to just pressing GIT pull / push. This allows only server-side GIT commands that implement the pull / push function to be executed. Commands can only be executed with the -c option; the shell is not interactive.

(Rup, in the comments, if you just played google git shell ...)

+12
source

An alternative would be to use gitolite or gitosis , both of which control this for you and are fairly easy to configure.

+3
source

Source: https://habr.com/ru/post/1313841/


All Articles