1、现象

  在linux ,用ssh进行远程连接时,经常会发生长时间后断线,或者是无响应,就像卡住的感觉(键盘输入不进去)。

2、解决方法

  在ssh客户端的linux设置

  # sudo vim /etc/ssh/ssh_config

  添加

  ServerAliveInterval 20

  ServerAliveCountMax 999

  保存并退出,就可以了。

  

  说明:

  1、ssh是通过客户端定时发送心跳,维持连接的,若是客户端与服务端长时间没有发送心跳的话,服务端会认为客户端已经下线,因此,自动断开连接。

  2、ServerAliveInterval 20  每隔20秒,向服务器发出一次心跳。

  3、ServerAliveCountMax 999   若请求次数超过999,都没有发送成功,则会主动断开与服务器的连接。

相关文章:

  • 2021-11-27
  • 2021-06-19
  • 2021-06-30
  • 2022-12-23
  • 2021-10-13
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-12-09
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案