帅秃顶的博客

  • 隐私政策🤝
  • 关于🏆
  • 友情链接🔗
热爱生活的每一天
帅秃顶的个人博客
  1. 首页
  2. linux
  3. 正文

ssh 一段时间不操作连接断开的解决办法

2025年4月24日 526点热度 1人点赞 0条评论

在 ssh 连接时,有时会遇到在一段时间不操作后,连接断开或连接卡死,无法输入的情况。解决方法是设置 ssh 每隔一段时间发送一个空请求。

配置 ~/.ssh/config 文件,增加以下内容即可:

Host *         
         # 断开时重试连接的次数         
         ServerAliveCountMax 5          
         # 每隔60秒自动发送一个空的请求以保持连接         
         ServerAliveInterval 60

或者添加在对应主机的 /etc/ssh/ssh_config 配置文件中。

标签: debian debian12 ssh
最后更新:2025年9月28日

帅秃顶

告别的年代,分开的理由,终不须诉说出口

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
帅秃顶 的头像
最近评论
porntude 发布于 6 天前(04月24日) So dive in, have fun
333985 发布于 2 周前(04月16日) wish you best and best
porntude 发布于 3 周前(04月07日) wish you all the best
porntude 发布于 1 个月前(03月22日) Very good i like it
两性资源 发布于 1 个月前(03月22日) 看不懂但大受震撼

COPYRIGHT © 2025 pigpigpigGo. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang