更新:2022.10.04 openssh9.1p1发布,2022.10.19重新编译。
由于官方没有rpm包,网上大部分教程都是通过源码编译升级,操作复杂且步骤较多。csdn上倒是有个现成的openssh8.3版本的rpm包,但是要好多积分,难受不。这里使用当前最新的openssh发布版本编译成了rpm包,可以使用yum升级。同时写了个升级脚本方便使用。好用的话大家给留个评论
编译及升级过程参考:https://www.cnblogs.com/yanjieli/p/14220914.html
升级包下载:
升级脚本:update.sh
#!/bin/bash
# by wzl
echo '当前版本:'
ssh -V
update() {
echo '备份配置文件'
cp /etc/pam.d/{sshd,sshd.bak}
cp /etc/ssh/{sshd_config,sshd_config.bak}
sleep 1
echo '更新rpm'
yum update -y ./openssh*
clear
echo '当前版本:'
ssh -V
echo '恢复配置'
mv -f /etc/ssh/sshd_config.bak /etc/ssh/sshd_config
mv -f /etc/pam.d/sshd.bak /etc/pam.d/sshd
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
chmod 600 /etc/ssh/*
echo '重启sshd'
systemctl restart sshd
}
echo '该脚本自动升级openssh到,在CentOS7.X测试通过,继续升级按y,取消n'
read -p "确认?[y/n]" input
if [ $input = "y" ];then
update
elif [ $input = "n" ]; then
echo "未升级,退出"
exit
else
echo "输入有误,请重新输入"
exit
fi
完美 感谢
下载不了
如果下载不了,可复制下载链接到新标签页下载
谢谢博主
谢谢博主
完美,感谢大佬
感谢大佬