I'm looking for a way to access to a server (D) through 2 proxy (B and C) using SSH keys stored on the first proxy (B). My computer (A) isn't allowed to save the key.
I understand the way to access to C using the key on B with an ssh config
file (cf this post):
Host C
ProxyCommand ssh -T -q -o 'ForwardAgent yes' B 'ssh-add -t 1 ~/.ssh/mykey && nc %h %p'
But from this point I can't use C as a proxy using the same method because C doesn't know the key to access to D. Only B does.
A ------------> B ------------> C ------------> D
key 1 from A key 2 from B key 3 from B
Is there any existing ssh property allowing to perform this action.
Thanks!