seconds between keepalives 设置为10就好了, 这个值有什么含义,服务器为了节省资源采取了一些措施,其中一条就是如果检测一个会话(session)几分钟或者几小时没有数据流入或者流出就会断开这个链接,占着茅坑不拉屎就是说这种情况,设置了putty中keepalive这个值之后比如是10,那putty每隔10秒就给服务器发送一个空数据包,以此来表示我还没拉完屎呢?这样厕所看管员就不会把我们踢出去了。

我这里找到了putty官方网站中关于keepalive的说明:

4.13 The Connection panel

The Connection panel allows you to configure options that apply to more than one type of connection.

4.13.1 Using keepalives to prevent disconnection

If you find your sessions are closing unexpectedly (most often with ‘Connection reset by peer’) after they have been idle for a while, you might want to try using this option.

Some network routers and firewalls need to keep track of all connections through them. Usually, these firewalls will assume a connection is dead if no data is transferred in either direction after a certain time interval. This can cause PuTTY sessions to be unexpectedly closed by the firewall if no traffic is seen in the session for some time.

The keepalive option (‘Seconds between keepalives’) allows you to configure PuTTY to send data through the session at regular intervals, in a way that does not disrupt the actual terminal session. If you find your firewall is cutting idle connections off, you can try entering a non-zero value in this field. The value is measured in seconds; so, for example, if your firewall cuts connections off after ten minutes then you might want to enter 300 seconds (5 minutes) in the box.

Note that keepalives are not always helpful. They help if you have a firewall which drops your connection after an idle period; but if the network between you and the server suffers from breaks in connectivity then keepalives can actually make things worse. If a session is idle, and connectivity is temporarily lost between the endpoints, but the connectivity is restored before either side tries to send anything, then there will be no problem - neither endpoint will notice that anything was wrong. However, if one side does send something during the break, it will repeatedly try to re-send, and eventually give up and abandon the connection. Then when connectivity is restored, the other side will find that the first side doesn't believe there is an open connection any more. Keepalives can make this sort of problem worse, because they increase the probability that PuTTY will attempt to send data during a break in connectivity. (Other types of periodic network activity can cause this behaviour; in particular, SSH-2 re-keys can have this effect. See section 4.19.2.)

在用navicat远程连接数据库之后,一段时间没有操作也会有断开连接这种情况,原理和putty的设置是一样的,在连接的高级设置里面有个keep alive 设置为10或者20就行。

长时间没有操作putty就会断开连接是怎么回事?的更多相关文章

  1. SSH连接服务器时,长时间不操作就会断开的解决方案

    最近在配置服务器相关内容时候,不同的事情导致长时间不操作,页面就断开了连接,不能操作,只能关闭窗口,最后通过以下命令解决. SSH连接linux时,长时间不操作就断开的解决方案: 1.修改/etc/s ...

  2. WPF窗口长时间无人操作鼠标自动隐藏

    在软件开发中有时会有等待一段时间无人操作后隐藏鼠标,可能原因大致如下: 1.为了安全性,特别是那些需要用到用户名和密码登录服务端的程序,常常考虑长期无人操作,程序自动跳转到用户登录界面: 2.软件为了 ...

  3. WinForm触摸屏程序功能界面长时间不操作自动关闭回到主界面 z

    操作者经常会在执行了某操作后,没有返还主界面就结束了操作然后离开了,程序应该关闭功能窗体自动回到主界面方便下一位操作者操作.那么对于WinForm程序怎么实现呢? 实现原理:拦截Application ...

  4. WPF程序长时间无人操作

    在软件开发中为了安全性,特别是那些需要用到用户名和密码登录服务端的程序,常常考虑长期无人操作,程序自动跳转到用户登录界面. 判断程序是否长时间无人操作,有两个依据,第一个是鼠标长时间不动,第二个是鼠标 ...

  5. Web页面长时间无操作后再获取焦点时转到登录界面

    今天开始讲新浪博客搬到博客园.        在工作中遇到的小问题,感觉有点意思,就记录下来吧!        该问题分为两种情况,一.Web页面长时间无操作后,在对其进行操作,比如点击“首页”.“设 ...

  6. ASP.NET 工作流:支持长时间运行操作的 Web 应用程序

    ASP.NET 工作流 支持长时间运行操作的 Web 应用程序 Michael Kennedy   代码下载位置:MSDN 代码库 在线浏览代码 本文将介绍以下内容: 独立于进程的工作流 同步和异步活 ...

  7. iOS开发笔记--如何实现程序长时间未操作退出

    我们使用金融软件经常会发现手机锁屏或者长时间未操作就会退出程序或者需要重新输入密码等情况.下面让我们看一下如何实现这种功能.我们知道iOS有一个事件循环机制,也就是大家所说的runloop.我们在对程 ...

  8. WPF:鼠标长时间无操作,窗口隐藏

    //设置鼠标长时间无操作计时器 private System.Timers.Timer MouseTimerTick = new System.Timers.Timer(10000); private ...

  9. web页面长时间未操作自动退出登录

    var lastTime = new Date().getTime(); var currentTime = new Date().getTime(); * * ; //设置超时时间: 10分 $(f ...

随机推荐

  1. unarjs识别组建compoment

    http://stackoverflow.com/a/28210364/1070244 判断自定义元素,是否为未知元素 chrome和firefox存在差异,尤老 研究的代码 // Chrome re ...

  2. 100个常用的Linux命令——转载

    1,echo “aa” > test.txt 和 echo “bb” >> test.txt //>将原文件清空,并且内容写入到文件中,>>将内容放到文件的尾部 2 ...

  3. 命令行下IIS的配置脚本Adsutil.vbs

    命令行下IIS的配置脚本Adsutil.vbs 2009-08-20 12:26:52  www.hackbase.com  来源:Jackal's Blog Jackal's Blog文件存在于:C ...

  4. vue set

    Vue 可以通过数组变异的方法可以控制数组的增减,却不能更改数组及对象,vue可以通过set方法改变数组的长度,改变某项的值,在组件中可以使用$set方法改变数组长度和某项的值 调用方法:Vue.se ...

  5. mysql ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

    为了加强安全性,MySQL5.7为root用户随机生成了一个密码,在error log中,关于error log的位置,如果安装的是RPM包,则默认是/var/log/mysqld.log. 一般可通 ...

  6. MySQL 事务 隔离级别

    前两天面试,问到了四种隔离级别,当时觉得大多数数据库都为read committed,结果没想到mysql是个例外.在此做一下隔离级别和各种数据库锁的使用. 首先说一下ACID四大特性: 四大特性   ...

  7. 苹果笔记本 如何配置成php开发系统

    方法一 启动内置的apace 打开终端输入命令 停止服务:sudo /usr/sbin/apachectl stop 开启服务:sudo /usr/sbin/apachectl start 重启服务: ...

  8. 如何添加Modeling 菜单

    创建page 在protal settings的cdoform中add new item 在modeing中就可以使用该对象对应的维护页面了.

  9. metasploit framework(十三):FTP扫描

    设置目标IP 查看是否支持匿名登录 获取到版本信息 使用ftp登录模块 搜索刚才获取到的版本信息,找到一个针对这个版本的漏洞利用代码

  10. javascript 页面导出功能

    javascript 页面导出功能 <a class="btn" href="javascript:void(0);" onclick="win ...