git - Is it possible to still execute hooks after disabling shell login?
某草草
某草草 2017-05-02 09:43:27
0
1
574

I followed this tutorialhttp://www.liaoxuefeng.com/wi... to set up the server. In the fifth step, I disabled shell login:
For security reasons, the git user created in the second step does not allow shell login. This can be done by editing /etc/ The passwd file is completed. Find a line similar to the following:
git: x :1001:1001:,,,:/home/git:/bin/bash
Changed to:
git: x :1001:1001:,,,:/home/git:/usr/bin/git-shell
In this way, the git user can use git through ssh normally, but cannot log in to the shell because the git- we specified for the git user The shell automatically exits every time you log in.

So, can my hook script still be executed? Does this mean that if you change it like this, you can’t operate it on the shell?
BTW, are hooks executed by git users?

某草草
某草草

reply all(1)
黄舟

Yes. The hook does not need to go through the login process used by humans.

Your configuration is performed by the git user (your ssh login address is git@....).

However, it is not recommended to configure it like this, because there is no reason to configure it like this... If you want to set it up yourself, if you are using it alone, just use your own account on the server. If multiple people use it, just use gitolite.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template