openssh版本升级至9.6p1
环境
- OS: Proxmox7.4 (Debian11)
设置apt
源
sed -i 's@deb.debian.org@mirrors.huaweicloud.com@g' /etc/apt/sources.list
sed -i 's@ftp.debian.org@mirrors.huaweicloud.com@g' /etc/apt/sources.list
apt update
取消proxmox对软件卸载的限制(暂时移除pve-apt-hook
)
mv /usr/share/proxmox-ve/pve-apt-hook /usr/share/proxmox-ve/pve-apt-hook.bak
touch /usr/share/proxmox-ve/pve-apt-hook && chmod 777 /usr/share/proxmox-ve/pve-apt-hook
备份相关配置文件并卸载ssh
systemctl stop ssh
mv /etc/ssh /etc/ssh-bak && mv /etc/pam.d/sshd /etc/pam.d/sshd-bak
apt remove openssh-server
恢复pve-apt-hook
mv /usr/share/proxmox-ve/pve-apt-hook.bak /usr/share/proxmox-ve/pve-apt-hook
安装依赖
apt install libssl-dev gcc g++ gdb cpp make cmake libtool libc6 autoconf automake pkg-config build-essential gettext
apt install libzstd1 zlib1g libssh-4 libssh-dev libc6-dev libc6 libcrypt-dev libpam0g-dev
Other helpful tools for debugging server issues
apt install netcat lsof wget diffutils
Download the 9.6 archive
cd /opt
VER=9.6p1
wget https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-${VER}.tar.gz
Verify the download using gpg
# Import the public signing key
wget https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc
gpg --import RELEASE_KEY.asc
# Verify
wget https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-${VER}.tar.gz.asc
gpg --verbose --verify openssh-${VER}.tar.gz.asc
Build
tar -xvf openssh-${VER}.tar.gz
cd openssh-${VER}
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords --with-pam
make
make install
还原配置文件
mv /etc/ssh /etc/ssh-9.6 && mv /etc/ssh-bak /etc/ssh
mv /etc/pam.d/sshd-bak /etc/pam.d/sshd
查看版本并启动
ssh -V
systemctl unmask ssh
systemctl start ssh
喜欢这篇文章的话 打赏一下吧!