OpenSSH用户枚举漏洞修复——ubuntu升级ssh版本

一、介绍

时不时会爆出来因版本问题导致的,使用不存在的用户名和存在的用户名返回不同信息的信息进行用户名枚举的特性,故要对ssh版本进行升级,改到不受影响的ssh版本。这里用升级到9.9p1的版本来演示。

二、步骤(均在root下操作)

0.环境查看

1.下载新包地址

OpenSSH: Release NotesOpenSSH release noteshttps://www.openssh.com/releasenotes.html

2.备份

mv /usr/sbin/sshd /usr/sbin/sshd.old
mv /usr/bin/ssh /usr/bin/ssh.old

3.安装依赖

apt-get update
apt-get install openssl gcc zlib1g.dev libssl-dev make -y

4.将包上传到服务器,解压安装

tar -zvxf openssh-9.9p1.tar.gz
cd openssh-9.9p1
./configure --prefix=/usr/local/openssh
make
make install

5.替换密钥文件(备份密钥,替换为旧版ssh密钥)

cp -r /usr/local/openssh/etc /usr/local/openssh/etc.bak
cp /etc/ssh/ssh_host_* /usr/local/openssh/etc

6.创建新版ssh软连接

ln -s /usr/local/openssh/sbin/sshd /usr/sbin/
ln -s /usr/local/openssh/bin/ssh /usr/bin/

7.重启,查看版本

systemctl restart sshd
ssh -V

为什么没有命令运行成功截图?没报错就是成功不需要截图(确信)

相关推荐
梦游钓鱼1 小时前
在window终端创建docker容器的问题
运维·docker·容器
孤寂大仙v1 小时前
【Linux笔记】理解文件系统(上)
linux·运维·笔记
沉默的八哥1 小时前
K8S高可用Web应用部署方案
运维
winyh52 小时前
Vite 打包后Nginx部署配置
运维·nginx
pyliumy2 小时前
在基于Arm架构的华为鲲鹏服务器上,针对openEuler 20.03 LTS操作系统, 安装Ansible 和MySQL
服务器·架构·ansible
运维小贺3 小时前
Nginx常用的模块
运维·nginx·正则表达式
努力学习的小廉3 小时前
深入了解Linux —— 调试程序
linux·运维·服务器
努力学习的小廉3 小时前
深入了解Linux —— git三板斧
linux·运维·git