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?


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.

  • 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 Apr 26 at 14:01

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.