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 ),默认 ...
随机推荐
- 机器学习三剑客之Matplotlib
matplotlib Matplotlib 是Python 2D绘图领域的基础套件,它让使用者将数据图形化,并提供多样化的输出格式.这里将会以四个小案例探索Matplotlib的常见用法 绘制折线 ...
- 【Swoole】简单安装与创建TCP服务器
pecl install swoole PHP的异步.并行.高性能网络通信引擎,使用纯C语言编写,提供了php语言的异步多线程服务器,异步TCP/UDP网络客户端,异步MySQL,异步Redis,数据 ...
- 绑定当前对象例子——Tag="{Binding}"
<TreeView Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment=&qu ...
- 使用memcache 心得和注意事项
内存分配机制:首先要说明的是Memcached支持最大的存储对象为1M.它的内存分配比较特殊,但是这样的分配方式其实也是对于性能考虑的,简单的分配机制可以更容易回收再分配,节省对于CPU的使用.这里用 ...
- poj1463 树形dp
树形dp裸题,不过输入是真的恶心,要字符串读入考虑数字大于等于10的情况 dp[i][j]表示i的子树在j状态的最小的边集覆盖,j为0表示不选当前结点,1表示选 转移方程(u->x是u的所有子节 ...
- MySQL InnoDB与MyISAM存储引擎差异
言: 之前简单介绍过 MySQL 常用的存储引擎,今天对两个主流的存储简单分析下差异,书上没有参考的笔试题解答注解: 差异: MyISAM 只支持表锁,不支持事务,表损坏率较高.较老的存储引擎. ...
- 制作导航菜单分隔线的总结:用css3
经过百度统计中国中使用谷歌浏览器比较多,我很奇怪,我身边的同事很少用谷歌,唯一我用谷歌的原因就是看上它调试能力和模拟手机. 下面是我个人制作的 预览用谷歌浏览器. <!doctype html& ...
- 20180831_jar包冲突2_天安微信httpclient冲突
一.异常现象 微信项目需要向腾讯服务器发送请求获取token. 但是在请求的时候抛了个异常: <2018-8-30 下午05时39分18秒 CST> <Notice> < ...
- Tomcat_总结_01_tomcat环境搭建
一.准备条件 1.安装jdk 二.安装tomcat 1.下载tomcat 去官网下载 64-bit Windows zip 版本的tomcat,并解压 https://tomcat.apache. ...
- 速记JVM内存模型和垃圾回收策略
一.常用JVM参数 -Xms: 初始堆大小 -Xmx: 最大堆-Xmn: 新生代大小 -Xss: 栈容量 -PermSize: 方法区大小 -MaxPermSize: 最大方法区大小 -MaxDire ...