i have some problems with the ssh proxycommand. The authentication on the proxy works fine, but when i want to login to the remote-host it fails. The problem seems to be, that the proxy tries to login with my local rsa_key and not with the key stored on the proxy. Is there a way to fix this?

This is what i want:

Local -- local rsa --> Proxy -- proxy rsa --> host

The Config-file i use:

User user
Port 22
IdentityFile ~/.ssh/id_rsa.pub

User user
Port 22
IdentityFile home/user/.ssh/id_rsa.pub
ProxyCommand ssh -W %h:%p -F ssh_config -p 22 192.168.178

closed as off-topic by Jakuje, slm Jul 15 '16 at 12:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jakuje, slm


This probably isn't the answer you want to hear, but you can't do what you're trying to do.

The ProxyCommand option in ssh expects to STDIN & STDOUT of the command to be connected directly to the destination host (%h) and port (%p). Thus it is the local ssh process which is talking to the remote sshd, not the proxy host's ssh process. And since it's the local ssh process talking to the remote, it doesn't have access to any ssh keys sitting on the proxy.

Ultimately you only have 2 options:

  1. Copy the ssh key off the proxy host and install it locally.
  2. Set up a local command which transparently executes ssh on the proxy. For example: alias sshp='ssh -t ssh'
  • Yeah this is what i did, after days of searching for the answere. I now just copy the rsa-keys from the proxy and it works fine. Not ideal but, better than nothing ;) thanks – ManuelP. Jul 15 '16 at 11:52

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