openeuler22.03sp3升级OpenSSH_10.2p1
·
openeuler22.03sp3升级OpenSSH_10.2p1
1. 生成RPM包
RPM包的生成,参见移条咸鱼的文章openEuler 22.03 制作openssh 9.9p2 rpm包–移条咸鱼,
虽然这个示例是9.9p2版本,但也适用于10.2p1。
2. 通过rpm包进行升级
将相关rpm包上传到待升级主机,我这里使用的是/root/software目录
2.1. 安装telnet服务
yum localinstall --disablerepo=\* /root/software/xinetd-2.3.15-35.oe2203sp3.x86_64.rpm
yum localinstall --disablerepo=\* /root/software/telnet-0.17-79.oe2203sp3.x86_64.rpm
#由于本次升级的主机不能访问公网,安装时需要禁用repo:--disablerepo=\*
vi /etc/xinetd.d/telnet
cat /etc/xinetd.d/telnet
service telnet
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
systemctl start xinetd
2.2. 备份相关配置
telnet 10.10.10.10
systemctl stop sshd
cp /etc/pam.d/sshd /etc/pam.d/sshd.bak
cp /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/sshd.service.bak
2.3. 升级openssh
cd software/
rpm -Uvh openssh-*.rpm
2.4. 恢复相关配置
ll /etc/ssh/
chown root:root /etc/ssh/ssh_host_*
chmod 600 /etc/ssh/ssh_host_*_key
cp /etc/pam.d/sshd.bak /etc/pam.d/sshd
cp /usr/lib/systemd/system/sshd.service.bak /usr/lib/systemd/system/sshd.service
2.5. sshd_config中注释掉GSSAPIKexAlgorithms
由于OpenSSH 上游原生代码中没有GSSAPIKexAlgorithms,升级后需要在sshd_config中注释掉这一行,大约在158行。
vi /etc/ssh/sshd_config
158# GSSAPIKexAlgorithms gss-group14-sha256-,gss-group16-sha512-,gss-curve25519-sha256-
2.5. 重启sshd服务
rm -f /etc/rc.d/init.d/sshd
rm -f /etc/init.d/sshd
# 以上两个文件会让系统以旧版 SysV 的模式启动sshd,删除后才能正常使用sshd.service
systemctl daemon-reload
systemctl enable sshd --now
鲲鹏昇腾开发者社区是面向全社会开放的“联接全球计算开发者,聚合华为+生态”的社区,内容涵盖鲲鹏、昇腾资源,帮助开发者快速获取所需的知识、经验、软件、工具、算力,支撑开发者易学、好用、成功,成为核心开发者。
更多推荐

所有评论(0)