Ubuntu升级ssh版本到9.8

方案一:实测只有8.9有漏洞不推荐

1、更新软件包列表

sudo apt update

2、查找可用版本

apt-cache policy openssh-server

3、 选择版本

sudo apt install openssh-server=1:9.8p1-<具体版本号>

4、 重启

sudo systemctl restart ssh

5、验证版本

/usr/sbin/sshd -V

方案二:推荐

1、安装依赖

sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libncurses5-dev libsqlite3-dev libgdbm-dev libdb-dev libexpat-dev libpcap-dev openssl

2、下载源码

wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz

3、解压

tar -xzf openssh-9.8p1.tar.gz
cd openssh-9.8p1

4、配置编译选项

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-ssl-dir=/usr/lib/x86_64-linux-gnu/

5、编译

make

6、备份

/etc/ssh/sshd_config

/etc/ssh/ssh_config

7、安装

sudo make install

8、重启

sudo systemctl restart ssh

9、验证

/usr/sbin/sshd -V

可能出现的错误

configure: error: PAM headers not found

1、原因

系统缺少PAM(Pluggable Authentication Modules)开发库和头文件。PAM是Linux系统中用于认证的重要模块,因此在编译某些软件时需要它的支持。

2、解决

sudo apt install libpam0g-dev
cd openssh-9.8p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-ssl-dir=/usr/lib/x86_64-linux-gnu/

相关推荐
YuMiao1 天前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
Sinclair4 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
Rockbean5 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
埃博拉酱5 天前
VS Code Remote SSH 连接 Windows 服务器卡在"下载 VS Code 服务器":prcdn DNS 解析失败的诊断与 BITS 断点续传
windows·ssh·visual studio code
茶杯梦轩5 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
海天鹰6 天前
【免费】PHP主机=域名+解析+主机
服务器
不是二师兄的八戒6 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
欧云服务器6 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian
芝士雪豹只抽瑞克五6 天前
Nginx 高性能Web服务器笔记
服务器·nginx
智渊AI6 天前
Ubuntu 20.04/22.04 下通过 NVM 安装 Node.js 22(LTS 稳定版)
ubuntu·node.js·vim