I am using the new ProxyJump option with SSH. I am having troubles with the IdentityFile for the proxy.
Sample SSH config:
Host proxy
HostName 1.0.0.1
User foo
Port 1234
Identityfile ~/.ssh/mykey.id_rsa
Host target
HostName 1.0.1.1
User bar
Port 5678
Identityfile ~/.ssh/mykey.id_rsa
ProxyJump proxy
ForwardAgent yes
Schematic:
ssh ssh
localhost ------> proxy ------> target
^ ^
using using
mykey mykey
Using the ssh command with this config works out:
ssh target
I am trying to perform this operation without the config file, but it does not work:
ssh -i ~/.ssh/mykey.id_rsa -AJ [email protected]:1234 [email protected]:5678
I can't find a way to specify the IdentityFile with -i
for both the ProxyJump host and the target host to make it work.
This works:
ssh -i ~/.ssh/mykey.id_rsa -AJ proxy [email protected]:5678
Is there a way of using the -i
,-A
,-J
or -o
flags to do this?