We have a server with some of our git repositories on and I would like to be able to clone one to our webserver (which runs debian). I ran ssh-keygen
on the webserver and copied the public key into authorized_keys
on the gitserver and so now I can successfully ssh to the gitserver from the webserver:
ssh -T user@gitserver.com
And it will log me in. However, if I call git clone on the webserver:
sudo git clone user@gitserver.com:/dir/repo.git
I get this response:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Does anyone know why this is happening? I read that I should allow ForwardAgent
in /etc/ssh_config on my local machine (running Max OS X), which I've done but didn't fix the issue.