openEuler的版本是openEuler 20.03,ssh的版本是OpenSSH_8.2p1
[root@test ~]# more /etc/os-release
NAME="openEuler"
VERSION="20.03 (LTS-SP3)"
ID="openEuler"
VERSION_ID="20.03"
PRETTY_NAME="openEuler 20.03 (LTS-SP3)"
ANSI_COLOR="0;31"
[root@test ~]# ssh -V
OpenSSH_8.2p1, OpenSSL 1.1.1f 31 Mar 2020
升级步骤
1、下载openssh-9.5p1,链接如下,下载后上传到/opt下面
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.5p1.tar.gz
2、升级ssh前安装必要的包--百度出来的必须包,没验证是否有多余的包
[root@test ~]#cheo "49.0.230.196 repo.openeuler.org" >> /etc/hosts
[root@test opt]# yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel
3、升级ssh包
[root@test ~]# cd /opt
[root@test opt]# tar zxvfp openssh-9.5p1.tar.gz
[root@test opt]# cd openssh-9.5p1
[root@test openssh-9.5p1]# ./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local
[root@test openssh-9.5p1]# make && make install
[root@test ~]#echo 'PermitRootLogin yes' >>/usr/local/openssh/etc/sshd_config
[root@test ~]#echo 'PubkeyAuthentication yes' >>/usr/local/openssh/etc/sshd_config
[root@test ~]#echo 'PasswordAuthentication yes' >>/usr/local/openssh/etc/sshd_config
[root@test ~]#mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
[root@test ~]#cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config
[root@test ~]#mv /usr/sbin/sshd /usr/sbin/sshd.bak
[root@test ~]#cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd
[root@test ~]#mv /usr/bin/ssh /usr/bin/ssh.bak
[root@test ~]#cp /usr/local/openssh/bin/ssh /usr/bin/ssh
[root@test ~]#mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
[root@test ~]#cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
[root@test ~]#mv /etc/ssh/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub.bak
[root@test ~]#cp /usr/local/openssh/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub
# modify Type=notify to Type=simple
[root@test ~]#sed -i "s/Type\=notify/Type\=simple/g" /usr/lib/systemd/system/sshd.service
[root@test ~]#systemctl daemon-reload && systemctl restart sshd
验证是否升级成功
[root@test openssh-9.5p1]# ssh -V
OpenSSH_9.5p1, OpenSSL 1.1.1f 31 Mar 2020
[root@test openssh-9.5p1]#
4、重启后验证
[root@test ~]# ssh -V
OpenSSH_9.5p1, OpenSSL 1.1.1f 31 Mar 2020