SSH隧道与autossh打破

我有+10服务器与主服务器的隧道。 不幸的是,有时这些服务器中有一些正在失去连接,不会恢复。 我理解的方式是监视端口不需要在networking中是唯一的。 我错了吗?

如果这不是问题,我应该怎么去debugging呢? 日志只有状态连接丢失。

autossh的手册明确指出,如果除了检查连接断开之外,您不需要它,则不应该使用监视。

For example, if you are using a recent version of OpenSSH, you may wish to explore using the ServerAliveInterval and ServerAliveCountMax options to have the SSH client exit if it finds itself no longer connected to the server. In many ways this may be a better solution than the monitoring port. 

因此,只需使用-M 0禁用autossh监视,并configurationServerAlive选项(间隔30,最大3是一个合理的默认值)。

你下一个debugging步骤(确保加载新的sshdconfiguration后)正在检查服务器日志(sshd可能会logging到/var/log/auth.log )和详细的客户端日志(尝试类似ssh -vvv -R port:ip:port master在你的一台服务器上,看看连接丢失是不是与networking有关的)。