Gitosis post-receive hook to deploy repository getting public key errors

后端 未结 1 605
失恋的感觉
失恋的感觉 2020-12-04 02:27

I have gitosis setup on my server and I\'m trying to create a post-receive hook that will checkout changes to a working directory on the remote machine.

Initially I

相关标签:
1条回答
  • 2020-12-04 03:13

    You need to make sure of the value of the $HOME environment variable for the git user executing that hook.

    $HOME/.ssh is where ssh will look for the private key during the handshake.
    Also, make sure the ssh directory on the gitosis end has the right permissions.

    server$ chmod go-w ~/
    server$ chmod 700 ~/.ssh
    server$ chmod 600 ~/.ssh/authorized_keys
    

    Finally see the "Permission denied (publickey)" section on GitHub, which repeat what I mentioned above about the HOME:

    This is usually caused when ssh cannot find your keys.
    Make sure your key is in the default location, ~/.ssh.

    0 讨论(0)
提交回复
热议问题