Running a “secure” git server over SSH without gitosis/gitolite?

后端 未结 3 1206
说谎
说谎 2021-02-19 17:17

Is it possible to run a git server over ssh, using authorized_keys and command= to restrict access to only the git repositories, without using gitosis/

3条回答
  •  春和景丽
    2021-02-19 17:59

    You can put this at the beginning of each line in authorized_keys2:

    no-port-forwarding,no-agent-forwarding,command="/usr/bin/git-shell -c \"$SSH_ORIGINAL_COMMAND\"" 
    

    That'll allow only git commands over ssh, but will still let you become that user if you need to mess around (from another account):

    sudo -u git -i
    

提交回复
热议问题