设置ssh会话过期时间

客户端配置选项:

编辑配置文件 ~/.ssh/config 加入以下配置项,如不存在新建一个即可:

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

服务器端:

编辑配置文件 /etc/ssh/sshd_config,取消掉其中以下两项的注释:

ClientAliveInterval 300
ClientAliveCountMax 2
posted @ 2019-02-22 14:05  隔壁老王python  阅读(660)  评论(0编辑  收藏  举报