openssh升级到8.0
linux使用yum更新到最新版本为7.4,使用某工具扫出漏洞,需要升级openssh,发现openssh升级到8.0比较简单,只需要替换rpm包即可
8.0只需要下载openssl-libs-1.0.2,openssl-1.0.2k,openssh-8.0,openssh-clients-8.0,openssh-debuginfo-8.0,openssh-server-8.0。使用rpm -Uvh *.rpm 升级安装
升级完有权限问题,重启失败
cd /etc/ssh
chmod 600 sshd_config ssh_host_dsa_key ssh_host_key
ssh_host_rsa_key
chmod 620 moduli
chmod 644 ssh_config ssh_host_dsa_key.pub ssh_host_key.pub
ssh_host_rsa_key.pub
service sshd start
升级到8.0后,rooy用户被禁止登陆,需要修改配置文件
vi /etc/ssh/sshd_config
查找PermitRootLogin
整行替换
PermitRootLogin yes
搞定,附上rpm包和脚本,解压后直接给脚本x权限执行会自动升级,会替换你的ssh配置文件,记得保存你自己的配置文件,根据需要进行调整。
PS:保持一个ssh登陆窗口,防止出现问题。