一、putty發生 network error

开始菜单进入regedit,尋找

HKEY_CURRENT_USER\Software\SimonTatham

并把这个目录下的子目录全部删除,删除前务必将PUTTY整个reg目录导出备份。

试过重启PUTTY后,注册表无法自动生成sshhostkeys目录,无奈只能重装putty。

二、putty使用之保持连接不要自动断开

利用putty工具登录服务器总是连接不上,这样的情况自己在刚接触putty时也遇到过。在 Connection 里面有个 Seconds between keepaliaves,这里就是每间隔指定的秒数,就给服务器发送一个空的数据包,来保持连接。以免登录的主机那边在长时间没接到数据后,会自动断开 SSH 的连接。如下图:

上图中,默认输入 0 是禁用保持连接,在这里我习惯的设置了 10。两个复选框都保持默认选中。

三、putty中解决SSH连接超时断开的两种方法

说说用SSH连接Linux时如果几分钟没有操作就会自动断开,要想连接上就要重新登录。有时候我们在操作中会耽误几分钟,超时断开对于我们来说是很麻烦的,尤其是在进行一些数据传输的时候,会更麻烦。我们怎样解决这样的问题呢?这里有两点解决办法。

一、配置客户端

1在 linux下的ssh命令:vim /etc/ssh/ssh_config

  然后找到里面的ServerAliveInterval 参数,如果没有你同样自己加一个就好了。参数意义相同,都是秒数,比如9分钟:

  ServerAliveInterval 540

  2 SecureCRT

  设置反空闲,如下图所示

  3 Putty

  启用putty keepalive

  putty -> Connection -> Seconds between keepalives ( 0 to turn off ),默认为0,改为60。

二、更改ssh服务器的配置文件/etc/ssh/sshd_config

  ClientAliveInterval指定了服务器端向客户端请求消息的时间间隔, 默认是0,不发送。而ClientAliveInterval 60表示每分钟发送一次,然后客户端响应,这样就保持长连接了。这里比较怪的地方是:不是客户端主动发起保持连接的请求(如FTerm, CTerm等),而是需要服务器先主动。

  另外,至于ClientAliveCountMax,使用默认值3即可。ClientAliveCountMax表示服务器发出请求后客户端没有响应的次数达到一定值,就自动断开,正常情况下,客户端不会不响应。

  ClientAliveCountMax

  Sets the number of client alive messages (see below) which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the ses-sion. It is important to note that the use of client alive messages is very different from TCPKeepAlive (below). The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive.The default value is 3. If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. This option applies to protocol version 2 only.

  ClientAliveInterval

  Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.

  vim /etc/ssh/sshd_config

  找到ClientAliveInterval 参数,如果没有就自己加一行。

  ClientAliveInterval 参数的数值是秒,比如你设置为540,就是9分钟.

  ClientAliveInterval 540

  对于ClientAliveCountMax

  指如果发现客户端没有相应,则判断一次超时,这个参数设置允许超时的次数,比如10。

  ClientAliveInterval 540

  ClientAliveCountMax 10;

  则代表允许超时 5400秒 = 90分钟。

其实,这两种解决办法的道理都是一样的,都是对数据的更改一下,只是进行的途径不一样。两种方法都很实用,供大家选择。

【转载】Putty出现 Network error:Software caused connection abort的更多相关文章

  1. Putty出现 Network error:Software caused connection abort

    使用centos7.5 用Putty连接使用没多久就会出现 Network error:Software caused connection abort #修改sshd配置文件.修改3项配置即可 vi ...

  2. network error:software caused connection abort

    使用Putty链接阿里云香港服务器报这个错误. vim /etc/ssh/sshd_config 找到如下配置 #ClientAliveInterval 540 #ClientAliveCountMa ...

  3. LoadRunner Error code 10053,Software caused connection abort

    发现问题的应用场景  C/S结构程序,请求响应采用异步机制.即客户端发送一个请求后不是一直等待这个结果,客户端将请求存放在请求队列并获得一个JOBID,服务器运行后将运行结果存放在响应队列,客户端定时 ...

  4. java.net.SocketException: Software caused connection abort: socket write error

    用Java客户端程序访问Java Web服务器时出错: java.net.SocketException: Software caused connection abort: socket write ...

  5. Software caused connection abort: socket write error

    Exception in thread "main" java.net.SocketException: Software caused connection abort: soc ...

  6. testNG java.net.SocketException: Software caused connection abort: socket write error

    执行用例报错,提示 java.net.SocketException: Software caused connection abort: socket write error java.net.So ...

  7. Caused by: java.net.SocketException: Software caused connection abort: socket write error

    1.错误描述 [ERROR:]2015-05-06 10:54:18,967 [异常拦截] ClientAbortException: java.net.SocketException: Softwa ...

  8. putty software caused connection abort

    错误现象:在非常短的时间内就失去连接.并报"Software caused connection abort" 解决的方法:首先得排除是网络不是不通畅.假设在局域网中要确定IP没有 ...

  9. jmeter压测tcp协议接口:java.net.SocketException: Software caused connection abort: socket write error

    tcp接口,试压过程中,部分请求报如下错误: java.net.SocketException: Software caused connection abort: socket write erro ...

随机推荐

  1. IIS webService 并发 性能

    IIS webService 并发 性能     做的WebService,客户压力测试500并发(随机步长60s-90s),响应速度不理想. 1,优化程序,压缩执行时间2,提高IIS“最大工作进程数 ...

  2. excel技巧--单元格合并与拆分

    如果要将上图的地区列做成下图的合并单一列: 有如下做法: (以下图表格为例) 1.选择要排序的表格,点击“开始”-->排序和筛选-->自定义排序.在对话框选择“业务项目”进行排序: 2.选 ...

  3. NDK学习笔记(Add.cpp注释)(一)

    // Add.C // Copyright (c) 2009 The Foundry Visionmongers Ltd. All Rights Reserved. static const char ...

  4. Python标示符和关键字

    标示符 什么是标示符,看下图: 标识符就是开发人员在程序中自定义的一些符号和名称. 标示符是自己定义的,如变量名 .函数名等. 标示符的规则 标示符由字母.下划线和数字组成,且数字不能开头 pytho ...

  5. adb调试android设备 说的比较清楚的一篇文章

    ADB支持两种连接Android系统的方式,USB方式及网络方式.一般手机及平板默认会设置为USB方式.android系统底层运行着一个服务(adbd),用于相应和管理大家在电脑端的adb命令连接,这 ...

  6. 当弹出的div失去焦点的时候自动隐藏

    jquery: $("#button").click(function(event){ $("#box").show(); event.stopPropagat ...

  7. 分布式消息队列RocketMQ--事务消息--解决分布式事务

    说到分布式事务,就会谈到那个经典的”账号转账”问题:2个账号,分布处于2个不同的DB,或者说2个不同的子系统里面,A要扣钱,B要加钱,如何保证原子性? 一般的思路都是通过消息中间件来实现“最终一致性” ...

  8. 结合《剑指offer(第二版)》面试题51来谈谈归并排序

    一.题目大意 给定一个数组A,对于数组A中的两个数字,如果排在前面的一个数字大于(必须大于,等于不算)后面的数字,则这两个数字组成一个逆序对.要求输出数组A中的逆序对的总数.例如,对于数组{7,5,6 ...

  9. 浙江财经大学第十五届大学生程序设计竞赛------B 烦恼先生打麻将

    问题 B: B - 烦恼先生打麻将 时间限制: 1 Sec  内存限制: 256 MB提交: 8  解决: 5[提交][状态][讨论版] 题目描述 输入 6 6 Z D 1S 1S 9W 5W 2S ...

  10. 基于folly的AtomicIntrusiveLinkedList无锁队列进行简单封装的多生产多消费模型

    1.基于folly的AtomicIntrusiveLinkedList略微修改的无锁队列代码: #ifndef FOLLY_REVISE_H #define FOLLY_REVISE_H namesp ...