centos7 openssh版本升级至 openssh-9.5p1

公司项目验收提示ssh版本存在漏洞,要求升级至最高版本,这里做个记录

默认版本

[root@localhost ~]# sshd -v
unknown option -- v
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
yum groupinstall -y "Development Tools"
yum install -y imake rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel perl-IPC-Cmd
git clone https://github.com/boypt/openssh-rpms.git
cd openssh-rpms/downloads/
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.5p1.tar.gz
wget -c https://www.openssl.org/source/openssl-3.0.11.tar.gz --no-check-certificate
tar -xf x11-ssh-askpass-1.2.4.1.tar.gz
tar -xf openssh-9.5p1.tar.gz
tar -xf openssl-3.0.11.tar.gz
cd ..
./compile.sh

cd /usr/src/soft/openssh-rpms/el7/RPMS/x86_64

[root@localhost x86_64]# rpm -Uvh *.rpm
[root@localhost x86_64]# sshd -v
unknown option -- v
OpenSSH_9.5p1, OpenSSL 3.0.11 19 Sep 2023

chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key

systemctl restart sshd 

-------------end

你可能感兴趣的:(服务器性能,SSH,ssh升级,openssh-9.5p1)