I'm working on remote servers and I need to do a git clone from a another server using my private key. But I don't want to store my key on the remote servers.

I want to avoid storing ssh key on the remote servers at all, even in a temporary file. Is this possible?

link|improve this question
feedback

2 Answers

up vote 5 down vote accepted

You want to use ssh-agent - this is an exact scenario for which it was designed.

ssh-agent provides authentication forwarding when you have used ssh to login to a remote server.

After configuring it, you can login to the remote server (using -A to forward the agent) and then do the git pull. It will forward the authentication request back to your local machine.

link|improve this answer
feedback

If you put your private key into environment variable it will not be much more secure. Note, that all environment variables are visible via /proc/$PID/environ. Use ssh-agent.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.