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/

相关推荐
峥无5 小时前
Linux进程信号:从基础概念到内核底层原理
linux·运维·服务器·信号处理
广州灵眸科技有限公司5 小时前
瑞芯微RV1126B开发板(EASY-EAI-PI2) 开发(编译)方式说明
linux·服务器·单片机·嵌入式硬件·电脑
土星云SaturnCloud5 小时前
土星云AI边缘计算SE110S系列模型部署实战-YOLOv5
服务器·人工智能·yolo·docker·边缘计算
北山有鸟5 小时前
用开发板的.config替换ubuntu中内核源码目录的.config
linux·运维·ubuntu
艾iYYY6 小时前
string 类的模拟实现
android·服务器·c语言·c++·算法
cjp5606 小时前
003.LINQ在WEB API中的应用
服务器·linq
周小码7 小时前
10分钟搭建私有Git服务器:Soft Serve实战
运维·服务器·git
知无不研7 小时前
对套接字的深入理解
linux·服务器·网络·c++·socket·网络套接字
ZStack开发者社区8 小时前
VMware替代:从POC通过到生产可用,差距在哪里
服务器·云计算·gpu算力
AI创界者8 小时前
运维进阶:如何使用 Medusa 进行企业内部服务器密码合规性审计?
运维·服务器