1.准备openssh rpm包
openssh rpm包打包方法见另一篇博客
2.备份openssh配置
mkdir /etc/sshconfig_backup cp /etc/ssh/sshd_config /etc/sshconfig_backup/ cp /etc/pam.d/sshd /etc/sshconfig_backup/pam.d_sshd
3.升级openssh
rpm -Uvh openssh*.rpm
4.还原ssh配置
cp /etc/sshconfig_backup/sshd_config /etc/ssh/sshd_config cp /etc/sshconfig_backup/pam.d_sshd /etc/pam.d/sshd
5.配置root登录
并加上PermitRootLogin yes允许root用户登录 echo "PermitRootLogin yes" >> /etc/ssh/sshd_config cat /etc/ssh/sshd_config | grep PermitRootLogin
6.删除key
echo “删除/etc/ssh/目录下相关key文件,否则重启sshd服务会报错” rm -rf /etc/ssh/ssh_host_*
7.重启ssh
service sshd restart
标签:sshd,openssh,sshconfig,etc,版本升级,ssh,config From: https://www.cnblogs.com/daiqinghui/p/17876798.html