1.将openssh-8.5p1.tar.gz传到服务器
scp openssh-8.5p1.tar.gz root@xxx.xxx.xxx.xxx:
2.备份配置文件
cp -r /etc/ssh /etc/ssh.bak/
cp -r /etc/pam.d/ /etc/ssh.bak/
3.解压
tar zxvf openssh-8.5p1.tar.gz
4.安装
rpm -Uvh openssh-*.rpm
5.恢复配置文件
cp -r -a /etc/ssh.bak/ssh /etc/
cp -r -a /etc/ssh.bak/pam.d /etc/
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
6.清除密钥缓存
rm -rf /etc/ssh/ssh_host_*
7.重启服务
service sshd restart
8.验证
ssh -V