ll openssh-9.3p2.tar.gz
mkdir /root/backup/openssh/ -p
mv /etc/ssh /root/backup/openssh/
mv /etc/pam.d/sshd /root/backup/openssh/etc_pam.d_sshd
apt install -y gcc make zlib1g zlib1g-dev libssl-dev libpam0g-dev
apt-get remove -y openssh-server
tar xf openssh-9.3p2.tar.gz
cd openssh-9.3p2/
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords --with-pam
make
make install
mv /etc/ssh/ /root/backup/openssh/ssh-9.3p2
mv /etc/pam.d/sshd /root/backup/openssh/etc_pam.d_sshd_9.3p2
mv /root/backup/openssh/ssh /etc/ssh
mv /root/backup/openssh/etc_pam.d_sshd /etc/pam.d/sshd
systemctl unmask ssh
systemctl restart sshd
systemctl status ssh
ssh -V
OpenSSH_9.3p2, OpenSSL 1.1.1 11 Sep 2018
参考:Ubuntu20.04 升级openssh9.4(源码升级)_openssh源码下载-CSDN博客