ubunt22.04系统内网升级openssh9.9

172 阅读1分钟

准备安装包

openssh-client_9.9p1-3ubuntu3_amd64.deb

openssh-server_9.9p1-3ubuntu3_amd64.deb

libc6_2.39-0ubuntu8.4_amd64.deb

libssl3t64_3.0.13-0ubuntu3_amd64.deb

locales_2.39-0ubuntu8_all.deb

libc-bin_2.39-0ubuntu8.4_amd64.deb

openssh-sftp-server_9.9p1-3ubuntu3_amd64.deb

 

连接到ubuntu后进入root

备份原ssh文件

cp -r /etc/ssh /etc/ssh_bak

cp -r /usr/sbin/sshd /usr/sbin/sshd_bak

 

查看系统架构

uname -m(注意是amd64还是arm64)如果是arm64位以上安装包需要根据实际情况下载对应版本安装包

安装libc6

dpkg -i libc6_2.39-0ubuntu8.4_amd64.deb
安装时可能会报错,因为libc_bin版本不兼容,尝试安装先libc_bin,然后安装locales,应该都会报错,输入安装locales之后重新安装libc6就可以了(原因目前没有查出来)

安装libc_bin

dpkg -i libc-bin_2.39-0ubuntu8.4_amd64.deb

安装 locales_2.39-0ubuntu8_all.deb

 dpkg -i locales_2.39-0ubuntu8_all.deb

安装libssl3t64_3.0.13-0ubuntu3_amd64.deb

dpkg -i libssl3t64_3.0.13-0ubuntu3_amd64.deb

此时可能会遇到与原版本libssl3不兼容的情况

删除原有版本:sudo apt-get remove --purge libssl3
如果卸载不成功报错
尝试使用sudo dpkg --purge --force-all libssl3

image.png 重新安装:sudo dpkg -i libssl3t64_3.0.13-0ubuntu3_amd64.deb

修复可能存在的依赖问题:sudo apt-get install -f

验证:dpkg -l | grep libssl3

安装openssh-client_9.9p1-3ubuntu3_amd64.deb

dpkg -i openssh-client_9.9p1-3ubuntu3_amd64.deb

安装openssh-sftp-server_9.9p1-3ubuntu3_amd64.deb

dpkg -i openssh-sftp-server_9.9p1-3ubuntu3_amd64.deb

安装openssh-server_9.9p1-3ubuntu3_amd64.deb

dpkg -i openssh-server_9.9p1-3ubuntu3_amd64.deb

完成后可能会让选择新老ssh的config版本,选择倒数第二个

完成之后重启服务并验证当前版本

    systemctl restart sshd

    sshd -V # 输出应为 9.8p1 或更高版本