Docs/shell/safe/09-timeout.sh
2022-10-18 16:59:37 +08:00

6 lines
251 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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