重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛
标题:
ubantu22.04下SSH升级到9.92p
[打印本页]
作者:
mahan
时间:
2025-8-31 15:28
标题:
ubantu22.04下SSH升级到9.92p
可能各位小伙伴的系统也面临等保测试高危漏洞问题了(低版本openssh存在多个高风险漏洞,如远程代码执行、缓冲区溢出等),下面就让我分享一下我的升级过程。
提前准备aliyun的镜像仓库地址:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb
https://mirrors.aliyun.com/ubuntu/
jammy main restricted universe multiverse
# deb-src
https://mirrors.aliyun.com/ubuntu/
jammy main restricted universe multiverse
deb
https://mirrors.aliyun.com/ubuntu/
jammy-updates main restricted universe multiverse
# deb-src
https://mirrors.aliyun.com/ubuntu/
jammy-updates main restricted universe multiverse
deb
https://mirrors.aliyun.com/ubuntu/
jammy-backports main restricted universe multiverse
# deb-src
https://mirrors.aliyun.com/ubuntu/
jammy-backports main restricted universe multiverse
deb
https://mirrors.aliyun.com/ubuntu/
jammy-security main restricted universe multiverse
# deb-src
https://mirrors.aliyun.com/ubuntu/
jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb
https://mirrors.aliyun.com/ubuntu/
jammy-proposed main restricted universe multiverse
# deb-src
https://mirrors.aliyun.com/ubuntu/
jammy-proposed main restricted universe multiverse
1、先升级相关包
apt update
apt install build-essential libssl-dev zlib1g-dev
apt-get install libpam0g-dev
AI生成项目
bash
2、备份ssh相关文件(由于之间自己没有删除原配置文件,明明是按照规范步骤升级,还是不能使用root登录,因为在安装时发现有配置文件不会覆盖,导致升级出现问题)
mv /etc/ssh/ssh_config /etc/ssh/ssh_config_backup
mv /etc/ssh/sshd_config /etc/ssh/sshd_config_backup
mv /etc/ssh/moduli /etc/ssh/moduli_backup
AI生成项目
bash
3、安装和编译
wget
https://cdn.openbsd.org/pub/Open ... penssh-9.9p2.tar.gz
tar -zxvf openssh-9.9p2.tar.gz
cd openssh-9.9p2
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam
make
make install
AI生成项目
bash
4、修改配置
vim /etc/ssh/sshd_config
在末尾添加
PermitRootLogin yes
X11Forwarding yes
PasswordAuthentication yes
AI生成项目
bash
5、重启
sudo systemctl restart sshd
查看版本
ssh -V
AI生成项目
bash
6、验证
telnet ip 22
欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2