windows
C:\Users\用户名.ssh
在里面新建文件,名为config
Host *
ServerAliveInterval 30
linux
所有用户
cat > /tmp/tmp_config <<EOF
Host *
ServerAliveInterval 30
ServerAliveCountMax 2
EOF
sudo cat /tmp/tmp_config >> /etc/ssh/ssh_config
仅自己
cat > /tmp/tmp_config <<EOF
Host *
ServerAliveInterval 30
ServerAliveCountMax 2
EOF
sudo cat /tmp/tmp_config >> ~/.ssh/config
参考文章
https://www.cnblogs.com/h07061108/p/4769663.html