Ssh – Automatically unlock keys on a remote host accessed via SSH

key-authenticationsshssh-agent

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?

Best Answer

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'

Related Question