问题原文
原帖链接 · JohnA · CC BY-SA 3.0
I have a requirement to have a users home workstation (mac) connect via ssh tunnel to a corporate bastion host (bastion.corpnetexternal.com) and through to a mac workstation (host.corpnetinternal.com) in the corporate network. Here is the connection string:
ssh -N -f -L 2345:host.corpnetinternal.com:22 [email omitted]
This is known to work, so no worries there.
The ssh tunnel needs to be automatically created and there must be monitoring ensure that it is functional end to end, and if not to be restarted.
Additionally, this functionality may not be dependent on or interrupted by a VPN tunnel that may or may not be present from the user remote workstation into the corporate network.
I would appreciate any suggestions. Please, no comments on the why of using ssh tunneling if a VPN is available. I have listed the requirements levied upon me.
已采纳解答
原帖链接 · Moshe Katz · CC BY-SA 3.0
AutoSSH does exactly what you need.
On MacOS, it can be installed through Homebrew with brew install autossh.
See the README for usage instructions, or here and here for some examples.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
