当 ssh 主机连接到 VPN 时,有没有办法让 ssh 连接保持活动状态?
Is there a way to keep ssh connections alive when ssh host connects to VPN?
我有一个远程主机 ( VPS ),我使用 SSH 连接到它并且工作正常。但有时我需要在上面建立VPN连接。
通过建立 VPN 连接,我的 ssh 中断并且不再响应并进一步尝试连接失败并出现错误:
ssh: connect to host 192.168.1.105 port 22: No route to host
如何配置 VPN 或 SSH 以解决此冲突?
当我搜索这个问题时,我看到了 iproutes 的配置和解决问题的规则 problem.But 我自己通过更改 SSH 连接客户端的 SSH 配置找到了一个简单的解决方案。
ssh 上有一些配置可以通过此 link 访问。
通过 link 我发现您可以创建或更改配置文件 ( ~/.ssh/conf )
nano ~/.ssh/conf
并将其更改为:
Host *
ServerAliveInterval 300
ServerAliveCountMax 2
我有一个远程主机 ( VPS ),我使用 SSH 连接到它并且工作正常。但有时我需要在上面建立VPN连接。
通过建立 VPN 连接,我的 ssh 中断并且不再响应并进一步尝试连接失败并出现错误:
ssh: connect to host 192.168.1.105 port 22: No route to host
如何配置 VPN 或 SSH 以解决此冲突?
当我搜索这个问题时,我看到了 iproutes 的配置和解决问题的规则 problem.But 我自己通过更改 SSH 连接客户端的 SSH 配置找到了一个简单的解决方案。
ssh 上有一些配置可以通过此 link 访问。
通过 link 我发现您可以创建或更改配置文件 ( ~/.ssh/conf )
nano ~/.ssh/conf
并将其更改为:
Host *
ServerAliveInterval 300
ServerAliveCountMax 2