Question

I have an AWS ubuntu 10.xx server. Due to technical issue, I'm running Git 1.7.4 instead of the latest one. (so I cannot use the credential helper).

At that server, it has a shell script calling git pull.

I have the rsa in that server. so if I go inside that server and do git pull, it will ask for passphrase. That's good and there is no problem at that point.

HOwever, if I call that shell script for git pull remotely, it will fail. because there is no prompt for the passphrase thus it will fail. I will get "Permission denied (publickey)".

So, what should I do?

Was it helpful?

Solution

You could use ssh-agent on the server to load the private key and enter the passphrase once. This will keep the key loaded until ssh-agent is killed, when rebooting for example.

You could also use SSH agent forwarding as @kostix suggests.

Also, does the shell script need to be run unattended? If not, I use and love fabric for tasks like this as it will forward any input prompts from the remote server to your local machine, in addition to all other kinds of awesomeness when automating tasks on remote servers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top