#!/bin/bash # 3分钟未操作,断掉连接 sed -i 's/^#ClientAliveInterval 0/ClientAliveInterval 60/' /etc/ssh/sshd_config sed -i 's/^#ClientAliveCountMax/ClientAliveCountMax/' /etc/ssh/sshd_config sed -i '$a\TMOUT=300\nexport TMOUT' /etc/profile