文章目录
文章声明
漏洞描述
OpenSSH命令注入漏洞(CVE-2023-51385)详细描述:
前述
注意事项:
此文升级是基于9.3p1升级9.6p1
备份openssh9.3p1的配置文件
[root@localhost ~]# mv /usr/sbin/sshd /usr/sbin/sshd-9.3p1
[root@localhost ~]# mv /usr/bin/ssh /usr/bin/ssh-9.3p1
[root@localhost ~]# mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen-9.3p1
[root@localhost ~]# mv /etc/init.d/sshd /etc/init.d/sshd-9.3p1
[root@localhost ~]# mv /etc/pam.d/sshd.pam /etc/pam.d/sshd.pam-9.3p1
下载 openssh9.6p1 的安装包:
OpenSSH官网:下载官网
或者是使用我提供的离线包:openssh7.4p1 升级到 openssh9.6p1 所需的离线包
网盘下载:
链接: https://pan.baidu.com/s/1eLN1mIZc2yW2KEMa03HCLQ?pwd=open
提取码:open
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz
解压并编译安装openssh9.6p1
# 将下载的openssh安装包移动到/usr/local下
[root@localhost ~]# mv openssh-9.6p1.tar.gz /usr/local/
# 进入/usr/local/目录解压openssh9.4
[root@localhost ~]# cd /usr/local/
[root@localhost local]# tar xf openssh-9.6p1.tar.gz
# 进入openssh目录
[root@localhost local]# cd openssh-9.6p1
# 编译安装
[root@localhost openssh-9.6p1]# CCFLAGS="-I/usr/local/include" \
LDFLAGS="-L/usr/local/lib64" \
./configure \
--sysconfdir=/etc/ssh \
--with-zlib \
--with-ssl-dir=/usr/local/openssl
[root@localhost openssh-9.6p1]# make -j 4
[root@localhost openssh-9.6p1]# make install
授权
[root@localhost openssh-9.6p1]# chmod 600 /etc/ssh/*
复制配置文件
[root@localhost openssh-9.6p1]# cp -rf /usr/local/sbin/sshd /usr/sbin/sshd
[root@localhost openssh-9.6p1]# cp -rf /usr/local/bin/ssh /usr/bin/ssh
[root@localhost openssh-9.6p1]# cp -rf /usr/local/bin/ssh-keygen /usr/bin/ssh-keygen
[root@localhost openssh-9.6p1]# cp -ar /usr/local/openssh-9.6p1/contrib/redhat/sshd.init /etc/init.d/sshd
[root@localhost openssh-9.6p1]# cp -ar /usr/local/openssh-9.6p1/contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
给sshd授予权限
chmod 755 /etc/init.d/sshd
启用sshd,生成服务配置文件,并重启服务
# 启用sshd,生成服务配置文件
[root@localhost openssh-9.6p1]# systemctl enable sshd
sshd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig sshd on
# 重启服务
[root@localhost openssh-9.6p1]# systemctl restart sshd
# 查看服务状态
[root@localhost openssh-9.6p1]# systemctl status sshd
验证升级是否成功
[root@localhost openssh-9.6p1]# ssh -V
OpenSSH_9.6p1, OpenSSL 1.1.1t 7 Feb 2023
相关专栏
专栏标题 | 专栏链接 |
---|---|
《OpenSSH 系列》 | https://blog.csdn.net/liu_chen_yang/category_12463139.html |
《Linux从入门到精通》 | https://blog.csdn.net/liu_chen_yang/category_10887074.html |
《Linux服务器安全》 | https://blog.csdn.net/liu_chen_yang/category_12390514.html |
相关文章
文章标题 | 文章链接 |
---|---|
【Linux】 OpenSSH_7.4p1 升级到 OpenSSH_8.7p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/130484944 |
【Linux】 OpenSSH_7.4p1 升级到 OpenSSH_9.3p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/131398113 |
【Linux】 OpenSSH_7.4p1 升级到 OpenSSH_9.3p2(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/133460612 |
【Linux】 OpenSSH_7.4p1 升级到 OpenSSH_9.4p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/133697104 |
【Linux】 OpenSSH_7.4p1 升级到 OpenSSH_9.6p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/136536352 |
【Linux】 OpenSSH_9.3p1 升级到 OpenSSH_9.3p2(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/133460539 |
【Linux】 OpenSSH_9.3p1 升级到 OpenSSH_9.5p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/134717718 |
【Linux】 OpenSSH_9.3p1 升级到 OpenSSH_9.6p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/136327961 |
【Linux】 OpenSSH_9.3p2 升级到 OpenSSH_9.4p1(亲测无问题,建议收藏) | https://liucy.blog.csdn.net/article/details/133682882 |