I’m trying to write a script that connect to a linux server by using an other one as a ProxyJump:
ssh -J root@proxyhost root@target
I have two different keys (actually ssh certificate) and I would like to tell ssh to use one for the proxy host and the other for the target. I know I could modify the ssh config for that but I would like to specify it on the command line so I don’t have to rely on a valid ssh configuration.
So I’m looking for something like:
ssh -i proxyhostkey -J root@proxyhost -i targetkey root@target
The ssh man page of the
-J options says (emphasis mine):
Note that configuration directives supplied on the command-line
generally apply to the destination host and not any specified jump
hosts. Use ~/.ssh/config to specify configuration for jump hosts.
Is it possible to do want I want ? Or do I have to ensure that the
~/.ssh/config file will be correct ?