This question already has an answer here:

I was wonder if there is an equivalent to pageant for Ubuntu. The Pageant tool load private keys for prolonged usage, so you won't have to load the keys (as well as heir passprhases, if there are any), each time anew.

How could you achieve this in Ubuntu, and especially the Ubuntu CLI?

marked as duplicate by David Foerster, Zanna, Videonauth, TheWanderer, Rinzwind Dec 25 '16 at 14:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You might need to bake something with expect – Marco Ceppi Feb 7 '11 at 16:21
  • @Marco I was hoping to avoid that. – myusuf3 Feb 7 '11 at 18:45
  • The gnome-keyring that is installed by default does that, what functionality are you missing in that exactly? – geirha Feb 7 '11 at 21:08
  • @geirha, I am trying to do something with Jenkins CI – myusuf3 Feb 8 '11 at 14:12

Here are two utilities you should run one after the other.

The first evaluates for the private key you already used to authenticate into the server.

The second loads this key to the memory.

This way you could login anytime and anywhere in the current session, if the public key has been added to .ssh/authorized_keys*:

eval $(ssh-agent)

How it works:

ssh-agent is the authentication agent itself, whereas ssh-add is used to add your private keys to this agent.

You execute ssh-agent as an evaluation for your private key and then use the ssh-add command to actually add your private keys to this agent, for prolonged usage.

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