7

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?

2 Answers 2

7

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.

4

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .