I'm trying to set up a git post-update hook for my gitosis repository to update a working copy on a remote server. What's the best and most secure way to run a script on the remote server without requiring authentication, since the hook will be running as the gitosis user on one machine, which doesn't have a counterpart on the other machine.
I considered using a public/private keypair without a passphrase, which is what I use to have the script automatically update the working copy on the local server (for gitosis, not ssh), but I'm a little hesitant to use the same key for authentication via ssh since if the private key is somehow compromised an attacker could log in without authenticating. Or am I worrying too much, and is this something that permissions will take care of anyway (private key must be chmod 0600)?