0

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!

Thibaut Guirimand
  • 153
  • 1
  • 1
  • 6
  • ssh-copyid is I think what you looking for – djdomi Sep 14 '21 at 16:45
  • You do realize that adding a remote key to your local agent.. *equals* downloading the key? The only way you could be using a remote key locally without copying it.. is to forward the agent connection the other way around, and keep all signature work on the machine with the key. – anx Sep 14 '21 at 16:49

0 Answers0