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