SSH ProxyJump with key on jump host

ssh

I'm trying to connect to a server through a jump host. I usually do this by first logging in to the jump host and using a key which is deposited there to log in to the server. Agent forwarding is disabled to the jump host.
I've found a shorthand which works:

ssh -t jump ssh server

But I'd like to make use of ProxyJump in .ssh/config.

Whenever I add a directive, it seems like it's trying to log in to the server with the key on my client and not the key on the jump host. How can I change that?

Best Answer

This is how the ProxyJump works -- it logs you to the first host, initiates IO forwarding and then logs you to the second host with the credentials in your local machine. This is the safer way since your credentials never leave your machine nor does the agent forwarded socket.

Move the key from the jumpbox to your machine or set up the authentication on the second host to accept your local credential/keys.

There is no simple way around that since the openssh developers are not interested in promoting bad security practices.

Related Question