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/

相关推荐
BD_Marathon8 小时前
SpringBoot——辅助功能之切换web服务器
服务器·前端·spring boot
晚风吹人醒.9 小时前
SSH远程管理及访问控制
linux·运维·ssh·scp·xshell·访问控制·远程管理
necessary65310 小时前
使用Clion查看linux环境中的PG源码
linux·运维·服务器
FL162386312912 小时前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
AOwhisky13 小时前
Linux逻辑卷管理:从“固定隔间”到“弹性存储池”的智慧
linux·运维·服务器
翼龙云_cloud13 小时前
阿里云渠道商:如何使用弹性伸缩来实现计算资源的弹性配置?
服务器·阿里云·云计算
05大叔13 小时前
大事件Day02
运维·服务器
五仁火烧14 小时前
Vue3 项目的默认端口行为
服务器·vue.js·nginx·容器·vue
刘一说14 小时前
TypeScript 与 JavaScript:现代前端开发的双子星
javascript·ubuntu·typescript
石像鬼₧魂石14 小时前
22端口(OpenSSH 4.7p1)渗透测试完整复习流程(含实战排错)
大数据·网络·学习·安全·ubuntu