Solaris10 如何设置空闲ssh连接超时断开
在ssh的配置文件中有2个参数可以控制空闲连接超时断开。这2个参数是ClientAliveCountMax和ClientAliveInterval。
Solaris10上设置空闲ssh连接超时断开的方法如下:
修改/etc/ssh/sshd_config文件,在文件中加入以下内容:
ClientAliveCountMax = 0
ClientAliveInterval = 600 #单位是秒 然后重启ssh服务:
#> svcadm restart ssh
这两个参数的说明参见man sshd_config
ClientAliveCountMax
Sets the number of client alive messages (see Clien-
tAliveInterval, below) that can be sent without sshd
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 session. It is important to note that the use of
client alive messages is very different from KeepAlive
(see below). The client alive messages are sent through
the encrypted channel and therefore will not be spoofa-
ble. The TCP keepalive option enabled by KeepAlive is
spoofable. The client alive mechanism is valuable when a
client or server depend on knowing when a connection has
become inactive.
The default value is 3. If ClientAliveInterval (below)
is set to 15, and ClientAliveCountMax is left at the
default, unresponsive ssh clients will be disconnected
after approximately 45 seconds.
ClientAliveInterval
Sets a timeout interval in seconds after which, if no
data has been received from the client, sshd sends 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 only to protocol version 2.
需要说明的是man里的说明似乎有错误。按照man里面的说明,如果设置ClientAliveCountMax=3,ClientAliveInterval=15,空闲连接应该在45秒左右自动断开,但实际测试时发现必须设置ClientAliveCountMax=0,空闲连接才能自动断开。
Solaris10 如何设置空闲ssh连接超时断开的更多相关文章
- Putty等工具中解决SSH连接超时断开的问题
转自:http://www.putty.ws/putty-chaoshi 1 在 linux下的ssh命令:vim /etc/ssh/ssh_config 然后找到里面的ServerAliveInte ...
- 设置树莓派SSH连接因超时闲置断开(转)
设置树莓派SSH连接因超时闲置断开 转自:http://shumeipai.nxez.com/2013/12/06/set-ssh-connection-is-disconnected-due-to- ...
- 解决ssh连接超时时间(ssh timeout)的设置方法
本文介绍下,linux中ssh连接超时时间的设置方法,以避免总是被强行退出.有需要的朋友,参考下吧.有关修改ssh连接超时时间的方法,网上介绍的很多了.比如下面这个:可以减少ssh连接超时等待的时间: ...
- setting>SSH>sessions setting>勾选ssh Keepalive[ MobaXterm】设置保持SSH连接
[ MobaXterm]设置保持SSH连接 ssh远程连接会在无操作时自动断开连接.为了保持程序运行和连接,需要设置保持连接. 1.MobaXterm如果使用了MobaXterm客户端,那么需要在设置 ...
- SSH连接自动断开的解决方法(deb/rpm)
######### 修改后的: ## # tail -f -n 20 sshd_config#MaxStartups 10:30:60#Banner /etc/issue.net # Allow cl ...
- linux ssh连接超时断连设置
以下均针对redhat6.5系统进行说明. 一.设置ssh超时断连 使用root用户,编辑/etc/profile文件,在 HOSTNAME='/bin/hostname' HISTIZE=30 后增 ...
- ssh连接超时自动断掉的解决办法
最近开始使用阿里云服务器ECS,系统是CENTOS7.4 ,通过SSH连接上自动创建的实例后,几分钟不操作,就自动断开,提示“信号灯时间已到”,非常影响工作. 解决办法: 默认镜像创建的实例,SSH服 ...
- ssh连接超时问题解决方案,每一种方案都可以
1.服务端修改 vim /etc/ssh/sshd_config 修改 ClientAliveInterval 60 ClientAliveCountMax 40 60秒,向客户端发送一次请求. 超过 ...
- SSH连接超时不自动断开
Putty 启用putty keepalive putty -> Connection -> Seconds between keepalives ( 0 to turn off ),默认 ...
随机推荐
- Java基础(7)-集合类3
list集合的特点 1)有序(存储和取出的元素一直) 2)可重复 List子类的特点 ArrayList 有序,可重复 底层数据结构是数组 查询快,增删慢 线程不安全,效率高 Vector 有序,可重 ...
- 10.0.4_CentOS_120g_for_Qt5.3.2
对应 VMware Workstation 版本为:“10.0.4 build-2249910”
- ImageSwitch图像切换控件
ImageSwitch图像切换控件 继承ViewAnimator所以可以做动画 继承ViewGroup所以可以装别的控件,所以ImageSwitch里面装的就是image,不过要找个ImageView ...
- numpy函数:[6]arange()详解
arange函数用于创建等差数组,使用频率非常高,arange非常类似range函数,会python的人肯定经常用range函数,比如在for循环中,几乎都用到了range,下面我们通过range来学 ...
- 五一清北学堂培训之Day 3之DP
今天又是长者给我们讲小学题目的一天 长者的讲台上又是布满了冰红茶的一天 ---------------------------------------------------------------- ...
- APP测试的那些坑
在记录app测试走过的那些坑之前,先总结下app测试的工作主要有哪些: 1.功能测试,无论是什么软件产品,必不可少的就是功能测试.我们需要测试这款app产品的功能是否完善,是否符合客户需求,是否符 ...
- python中正则表达式的一些问题
今天听到一句话,觉得很在理——"当你遇到一个问题,想到用正则表达式解决时,就变成了两个问题" 这也从侧面说明了正则表达式比较难理解.下面我将用通俗易懂的方式总结一下,最近遇到的一些 ...
- 牛客练习赛7E 珂朵莉的数列
题意:求所有子区间的逆序数对数之和 题解:树状数组维护,对于每一对逆序数(l,r)属于l*(n-r+1)个区间,计算每一对对结果的贡献即可,可用树状数组维护,sum维护(n-r+1),按逆序数那样操作 ...
- python sort() sorted() 与argsort()函数的区别
1.python的内建排序函数有 sort.sorted两个 sort函数只定义在list中,sorted函数对于所有的可迭代序列都可以定义. for example: ls = list([5, 2 ...
- Linux_总结_01_VMware14虚拟机下安装CentOS7.x
一.前言 本文是采用最小安装方式 二.下载 1.官网 https://www.centos.org/download/ 在此页面下,选择 Minimal ISO 进行下载. 三.VMWare中新建虚拟 ...