Score:0

SSH from A through B, C to D using private key on B to access C and D

cn flag

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!

djdomi avatar
za flag
ssh-copyid is I think what you looking for
anx avatar
fr flag
anx
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.