Follow

阻止ssh自动断开

cd /etc/ssh

grep ClientAlive sshd_config

cp sshd_config sshd_config.bak
sed -i "s/#ClientAliveInterval 0/ClientAliveInterval 60/g" sshd_config

sed -i "s/#ClientAliveCountMax 3/ClientAliveCountMax 3/g" sshd_config

grep ClientAlive sshd_config

diff sshd_config sshd_config.bak

service sshd reload

· · Web · 1 · 0 · 1

@mashiro 默默的看了下我自己写的脚本。。。
sed -i '/^PasswordAuthentication/c PasswordAuthentication yes' ${SSHD_CONFIG}
😂

Sign in to participate in the conversation
小森林

每个人都有属于自己的一片森林,也许我们从来不曾走过,但它一直在那里,总会在那里。迷失的人迷失了,相逢的人会再相逢。愿这里,成为属于你的小森林。