openssh版本升级
OpenSSH_7.4版本曝出OpenSSH 输入验证错误漏洞(CVE-2019-16905),安全漏洞(CVE-2021-41617),OpenSSH 安全漏洞(CVE-2021-28041),修复方法为升级OpenSSH。
centos7 openssh 8.9 rpm 下载
链接:https://pan.baidu.com/s/1j7eNlQ02qsax0dyOtCWYuw
提取码:rggy
(1) 检查环境
[root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@localhost ~]# uname -r 3.10.0-957.el7.x86_64 [root@localhost ~]# ssh -V OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 [root@localhost ~]# yum list installed|grep openssh Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast openssh.x86_64 7.4p1-16.el7 @anaconda openssh-clients.x86_64 7.4p1-16.el7 @anaconda openssh-server.x86_64 7.4p1-16.el7 @anaconda
(2)解压rpm包
上传openssh-rpm-8.9.zip到服务器
[root@localhost ~]# unzip openssh-rpm-8.9.zip [root@localhost ~]# cd openssh-rpm-8.9 [root@localhost ~]# ll *.rpm -rw-rw-r--. 1 root root 665248 8月 10 17:32 openssh-8.9p1-1.el7.centos.x86_64.rpm -rw-rw-r--. 1 root root 44412 8月 10 17:32 openssh-askpass-8.9p1-1.el7.centos.x86_64.rpm -rw-rw-r--. 1 root root 653944 8月 10 17:32 openssh-clients-8.9p1-1.el7.centos.x86_64.rpm -rw-rw-r--. 1 root root 3248396 8月 10 17:33 openssh-debuginfo-8.9p1-1.el7.centos.x86_64.rpm -rw-rw-r--. 1 root root 463896 8月 10 17:33 openssh-server-8.9p1-1.el7.centos.x86_64.rpm
(3) 备份相关数据
[root@localhost ~]# cp -ra /etc/ssh /etc/ssh_bak [root@localhost ~]# cp -a /etc/pam.d/sshd /etc/pam.d/sshd_bak
(4) 安装rpm包
[root@localhost ~]# rpm -Uvh openssh-*.rpm --nodeps --force
(5) 修改相关配置
[root@localhost ~]# cd /etc/ssh [root@localhost ~]# chmod 600 ssh_host_ecdsa_key ssh_host_ed25519_key ssh_host_rsa_key [root@localhost ~]# vim sshd_config #修改以下两项(把前面的#删掉) PermitRootLogin yes #必须执行 PasswordAuthentication yes #还原pam文件 [root@localhost ~]# cat /etc/pam.d/sshd_bak > /etc/pam.d/sshd #重启sshd [root@localhost ~]# systemctl restart sshd
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库