ssh 配置超时

永不超时
# ClientAliveInterval 120:表示服务器每隔120秒向客户端发送一次“空包” 。
# ClientAliveCountMax 0:表示服务器不会因为客户端无响应而断开连接,从而实现“永不超时”
ClientAliveInterval 120
ClientAliveCountMax 0


# 重启ssh
sudo systemctl restart sshd

# 系统取消 TMOUT 超时时间限制
echo "unset TMOUT" >> /etc/profile
source /etc/profile