9

I would like to have all my SSH connections to my corporate network go through a particular jump host:

Host *.initech.biz
    ProxyJump conclusions.initech.biz

This accidentally causes SSH to try to jump to conclusions.initech.biz infinitely.

How can I break this recursion?

2 Answers 2

13

You should be able to do this:

Host *.initech.biz !conclusions.initech.biz
    ProxyJump conclusions.initech.biz

This matches "*.initech.biz" except for "conclusions.initech.biz".

See this answer.

1
  • I like this answer better than mine. It is shorter and it doesn't rely on the fact that ProxyJump none is technically undocumented.
    – rgov
    Commented Apr 26, 2021 at 14:01
10

I think this works:

Host conclusions.initech.biz
    ProxyJump none

Host *.initech.biz
    ProxyJump conclusions.initech.biz

Settings for hosts that appear earlier in the file override those that come later.

The ssh_config documentation does not explicitly mention that none is valid value for ProxyJump, but it does appear to work on macOS 11.2.3 ssh, which is OpenSSH_8.1p1, LibreSSL 2.7.3.

1
  • 1
    You can also use ProxyCommand none on any system where ProxyJump none doesn't work (if there are any).
    – Brandon
    Commented Apr 26, 2021 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .