0

I need to use SSH over SSH without confirmation in two hosts or at lease without confirmation on the second host.

Expected behavior:

ssh -t -o 'StrictHostKeyChecking no' user@machineB ssh -o 'StrictHostKeyChecking no' user@machineA

Currently working only:

ssh -t -o 'StrictHostKeyChecking no' user@machineB ssh user@machineA
grooveplex
  • 2,506
  • 3
  • 27
  • 35
goldver
  • 101
  • 2

1 Answers1

0

Try using quotes for everything after the first ssh command:

ssh -t -o 'StrictHostKeyChecking no' user@machineB "ssh -o 'StrictHostKeyChecking no' user@machineA"

I'm not sure as to your purpose with the -t flag, it is not mentioned in the docs. If you need it for the first ssh command, then you probably need it for the second ssh as well, so, if the above doesn't work, try either of these:

Both -t :

ssh -t -o 'StrictHostKeyChecking no' user@machineB "ssh -t -o 'StrictHostKeyChecking no' user@machineA"

Neither -t :

ssh -o 'StrictHostKeyChecking no' user@machineB "ssh -o 'StrictHostKeyChecking no' user@machineA"
Jesse
  • 140