Rocky Linux 8.3 RC1 OpenSSH升级至openssh-8.6p1荐

文章声明:此文基于木子实操撰写
生产环境:Rocky Linux release 8.3, Ubuntu 20.04.2 LTS, openssh-8.6p1
问题关键字:OpenSSH 升级, OpenSSH 更新, OpenSSH 漏洞修复
-opening--山水画
# 前述
OpenSSH(OpenBS双生幻想D Se升级系统cure Sheopenid什么意思ll)是OpenBSD计划组的一套用于安全访问远程计算机的连接工具。该工具是SSH协议的开源实现,支持对所有的传输进行加密,可有效阻止窃听、连接劫持以及其他网络升级鸿蒙系统名单级的**openwrt*。
OpenSSH 8.3p1及之前版本中scp的scp.c文件存在操作系统命令注入漏洞。该漏洞源于外部输入数据构造操作系统可执行命令过程中,网络系统或产品未正确过滤其中的特殊字符、命令等。***者可利用该漏洞执行非法操作系统命令。
详细参考国家信息安全漏洞库信息: [CVE-2020-15778](http://www.cnnvd.org.cn/web/xxk/ldxqindividualById.tag?CNNVD=CNNVD-202007-1519)
目前Rocky Linux 8.3 RC1 采用的为OpenSSH_8.0p1,所以建议通过升级OpenSSH修复此问题。同样OpenSSH before 8.5也存在漏洞,所以建议修复至最新版本OpenSSH_8.6p1。
**注:**此操作步骤同样适用于Red Hat系所有7.x 8.xopenid什么意思服务器系统。
![](https://oubayun.gitee.io/blogimage/_v_imaopenges/20210512114736079_636523018.png)
![](https://oubayun.gitee.io/blogimage/_v_images/20210512115527644_1426317819.png)
在升级之前,建议打开多个SSH终端连接,并安装telnet服务器,确保在生石灰SSH服务器升级linux是什么操作系统异常时,可以通过teln双生幻想礼包码et服务器远程连接,进行紧急问题ins修复处openlaw理。
Red Hat & CentinstagramOS 7.x 服务SSH器上,只需要将`dnf`命令替换成`yum`命linux是什么操作系统令即可。
# Telnet服务器部署
```bash
# 安装telnet服务器
dnf install升级鸿蒙系统名单 -y telnet-server
# 启动telnet服务器
systemctl start telnet.socket
# 配置防火墙,放行23端口
firewall-cmd --zone=public --升级尝鲜permanent --ad升级鸿蒙系统d-port=23/tcp
# or (永久生效加 --permanent)
firewall-initialcmd --add-service=telopenharmonynet --zone=public
# 重载防火墙配置
firewall-cmd --reload
# SELinux配置
semanage port -a -t telnetd_port_t -p tcp
```
# 升级OpenSSH
```bash熟石灰
# 查看当前安装包
[root@localhost ~]# rpm -qa | grep openssh
openssh-clients-8.0p1-5in.el8.x86_64
openssh-8.0p1-5.el8.x86_64
openssh-server-8.0p1-5.el8.x86_64
# 查看当前OpenSSH版individual本(Rocky Linux 默认使用OpenSSH 8.0p1)
[root@localhost ~]#linux ssh -V
OpenSSH_8.0p1, OpenSSL 1.1.1g FIPS 21 Apr 2020
# 备份现有SSH
[root@localhost ~]# mv /etc/ssh/ /etc/ssh.bak
[root@localhost ~]# mv /initialusr/bin/ssh /usr/bin/ssh.bak
[root@localhost ~]# mv /usr/sbin/sshd /usr/sbinlinux/sshd.bak
# 如果您是第一次升instagram安卓下载级,备份/etc/init.instagramd/sshd时会不存在,不影响后续操作
[root@localhost ~]# mv /etc/in升级鸿蒙系统步骤it.d/sshd /etc/init.d/sshd.bak
mv: 无法获取'/etc/init.熟石灰d/sshd' 的文件状态(stat): No such file or dire升级鸿蒙系统ctory
# 卸载现有OpenSSH
[root@localhost ~]# rpm -e --nodeps $(rpm -qa |grep openssh)
警告:文件 /etc/ssh/sshd_config:移除失败:No such file or directory
警告:文件 /etc/ssh/ssh_config.d/05-redhat.conf:移linux创建文件除失败opencv:No such file or directory
警告:文件 /etc/ssh/ssh_config.d:移除失s是什么意思败:No such file or directory
警告:文件 /etc/ssh/ssh_config:移除失败:No such file or directory
警告:文件 /etc/ssh/moduli:移除失败:No such升级鸿蒙系统 file or directory
警告:文in双生幻想 /etc/ssh:移除失败:No such file or directory
# 确保已经卸载成功
[root@localhost ~]# rpm -qa | grep openssh
# 安装编译openssinstagramh所需要使用的包
[root@localhost ~]# dnf install wget gcc opensopenstacksl-devel pam-devel rpm-build -y
# 下载OpenSSH二进制包
[root@localhost ~]# wget https:/水深火热/cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.6p1.tar.gz
[root@localhost ~]# tar -zxvf openssh升级系统-8.6p1.tar.gz
[root@localhost ~]# cd openssh-8.6p1
# 编译安装
[root@localhost openssh-8.6p1]# ./升级鸿蒙系统步骤configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-ssl-dir=/usr/local/ssl --without-hardening
[root@localhost openssh-8.6p1]# make
[root@localhost openssh-8.6p1]# make install
# 授权
[root@localhost openssh-8.6p1]# chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_升级host_e升级鸿蒙cdsa_key /etc/ssh/ssh_host_ed25519_key
# 复制配置文件
[root@localhost openssh-8.6p1]# cp -a contrib/redhat/sshd.init /etc/init.d/sshd
[root@localhost openssh-8.6p1]# cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
# 修改配ins下载置允许linux创建文件root用户远程双生幻想礼包码登录
[root@localhost openssh-8.6p1]#水深火热 echo "Paslinux系统swordAuthentication yes" >introduce;> /etc/ssh/sshd_config
[root@localhost openssh-8.6p1]# echo "PermitRootLogin yes" &gopent;> /etc/ssh/sshd_config
[root@localhost openssh-8.6p1]# sed -i "s/^#Port/Port/g" /etc/ssh/sshd_config
[root@localhost openssh-8.6p1]# chmod 755 /etc/init.d/sshd
# 启用sshd,生成服务配置文件
[root@localhost openssh-8.6p1]# systemctl enabopenrestyle sshd
sshd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/syste升级鸿蒙md/systemd-sysv-install enable sshd
# 重启服务
[root@localhost openssh-8.6p1]# systemctl restart sshd
# 验证升级是否成功
[root@localhost ~]# ssh -Vinto1
OpenSSH_8.6p1, OpenSSL 1.1.1g FinitialIPS 21 Apr 2020
```
# 禁用SCP与SFTP
有时候OpenSSH会出现一些其它漏洞,如O山水画penSSH 8.3p1及之前的版本,会存在scopenrestyp漏洞等,建议禁用sftp及scp,详细操作如下:
```bash
# 禁用sftp
[root@localhost ~]# sed -i "s/^Subsystem/#Subsystem/g" /etc/ssh/sshd_config
# 确保sftp已经禁用
[root@localhost ~]# cat /e双生花tc升级鸿蒙系统会不会丢失数据/ssh/insshd_config | grep sftp
#Subsystem sftp /usr/libexec/sftp-server
# 因为禁用scp是一件麻烦的事情,可以直接双生幻想删除scp命令或者重命名,相对来说更熟石灰靠谱一些。
rm -openid什么意思rf升级鸿蒙系统 /inus是什么意思sr/bin/scp
# 重启sshd服务
[root@localhost openssh-8.6p1]# systemctl restart sshd
```
# Ubuntu 服ins下载务器升级OpenSSH
因为木子刚好openstack有`Ubuntu 20.04.2 LTS`服务器需要升级,所以这里将对应的升级方法一并提供。
```bash
# 下载OpenS双生幻想SH二进制包
root@localhost:~# wget https://cdn.openbsd.org/pub/OpenBSD/OpeninitialSSH/portable/openssh-8.6p1.tar.gz
root@localhost:~# tar -zxvf openssh-8.6p1.tar.gz
roots是什么意思@localhost:~# cd openssh-8.6p1
# 编译安装
rlinux系统安装oot@localhost:~# /双生幻想configure --升级尝鲜prefix=/usr --sysconfdir=/etc/ssh水深火热 --with-md5-passwords --with-pam --with-zlib --with-privsep-path=/var/lib/sshd
root@localhost:~# make
root@localhost:~# make install
# 重启服务
roinot@localhost:~# systemctl restart sshd
# 验证升级是否成功
roos是什么意思t@localhost:~# ssh -V
OpenSSH_8.6p1, OpenSSL 1.1.1f 31 Mopenlawar 2020
```
# 写在最后
最后再补上两句:安全无小事,防范是关键。安全无小事,责任大于天。
下篇预告:**基于Roins下载cky Linux 8.3 RC1搭建Rsync冷备容灾服务器**open是什么意思,如果您有任何想学introduce习了解的技术,欢迎在下方留言,木子将根据需求输出对应基础技术博文。
# 参考文献
[1] 国家信息安全漏洞库:http://www.cnnvd.org.cnlinux重启命令/
[2] 腾讯安全:https://slinux.tencent.cins下载om/research/inbsafe/
----
**五平台同步更新:**
**博客:** [欧巴云](https://www.oubayun.com)
**知乎:** [欧巴云](https://www.zhihu.com/people/ou-ba-yun)
**51CTO:** [欧巴云](https://blog.51cto.com/oubayun)
**云+社区:** [欧巴云](https://cloud.tencentlinux系统安装.com/developer/user/42instead02074)
**微信公升级鸿蒙系统名单众号:** 欧巴云