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?

  • 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? Commented Apr 28, 2013 at 20:44
  • @Gilles gnome-keyring is unlocking the keys (I use XFCE). Is this relevant?
    – ntd
    Commented Apr 29, 2013 at 6:19

2 Answers 2


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'

  • It works! And I don't need to keep the keys in the remote host too. Many thanks Anthon, I owe you one.
    – ntd
    Commented Apr 29, 2013 at 6:46

You may want to play with Keychain.

You must log in to answer this question.

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