Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my local PC my ssh keys are automatically unlocked on login. From there I access via ssh (with key authentication) a server that have stored the same keys I have in the client. I'd like to unlock those keys in the server as well without having to digit the passphrase.

Is there a way to automatically unlock the keys in the remote host after a succesfull SSH login?

share|improve this question
If your keys are unlocked at login, it means that some program has stored their password, presumably Gnome-keyring or Kwallet. What desktop environment do you use? – Gilles Apr 28 '13 at 20:44
@Gilles gnome-keyring is unlocking the keys (I use XFCE). Is this relevant? – ntd Apr 29 '13 at 6:19
up vote 4 down vote accepted

You probably want to unlock private keys on your server to access different machines from there using these keys. Since these are the same keys as on your local machine, there is an easier way than unlocking those, by using ssh key forwarding. This concept is described here in the section ' Public Key Access with Agent Forwarding'.

From the commandline invocation of ssh you can use the '-A' option, or e.g. for openssh you can set the

'ForwardAgent Yes'

in your configuration file '~/.ssh/config'

share|improve this answer
It works! And I don't need to keep the keys in the remote host too. Many thanks Anthon, I owe you one. – ntd Apr 29 '13 at 6:46

You may want to play with Keychain.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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