逐个执行或者复制一键执行些命令
cp /etc/ssh/sshd_config > /etc/ssh/sshd_config.bak
sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i "s|#ClientAliveInterval 0|ClientAliveInterval 60|" /etc/ssh/sshd_config
sed -i "s|#ClientAliveCountMax 3|ClientAliveCountMax 3|" /etc/ssh/sshd_config
service ssh restart && service sshd restart && systemctl restart ssh && systemctl restart sshd && /etc/init.d/ssh restart && /etc/init.d/sshd restart
echo root:${1:-uIBeBgQ3itF4ryL231} | chpasswd
密码为 uIBeBgQ3itF4ryL231