centos7 升级openssh-10.2

首先上传openssh-10.2p1_amp_openssh-3.0.18.el7.zip

如网上找不到资源,翻到最后有网盘链接;

如果链接失效被和谐,可私信我!

复制代码
#查看当前版本
sshd -V
    OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
ssh -V
    OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
​
ls -lh /etc/ssh/ssh_host_*key
​
#升级安装
unzip openssh-10.2p1_amp_openssh-3.0.18.el7.zip
cd openssh-10.2p1_amp_openssh-3.0.18.el7
rpm -Uvh openssh*.rpm
​
#验证版本
sshd -V
    OpenSSH_10.2p1, OpenSSL 3.0.18 30 Sep 2025  
ssh -V
    OpenSSH_10.2p1, OpenSSL 3.0.18 30 Sep 2025
​
#修改安全权限
ls -lh /etc/ssh/ssh_host_*key
chmod 600 /etc/ssh/ssh_host_rsa_key 
chmod 600 /etc/ssh/ssh_host_ecdsa_key 
chmod 600 /etc/ssh/ssh_host_ed25519_key
​
​
#重启服务
systemctl restart sshd
​
#远程验证
​
openssh升级后root无法远程登录报错:

pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=x.x.x.x user=root

1.查看sshd服务的状态,必须为开启状态。

2.查看selinux的状态,在/etc/sysconfig/selinux文件中更改selinux的状态为disabled关闭状态。

3.查看防火墙的状态,必须为关闭状态。

4.查看/etc/ssh/sshd_config配置

常见的修改配置有:PermitRootLogin yes、PubkeyAuthentication yes、PasswordAuthentication yes

注意:如果是 #PermitRootLogin yes ,请将注释取消

欧拉2203系统
  • 查看/var/log/message 中启动报错
  • 注释sshd_config配置文件中的如下内容

#PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa

  • 或者

#GSSAPIKexAlgorithms gss-group14-sha256-,gss-group16-sha512-,gss-curve25519-sha256-

再次重启

systemctl restart sshd

网盘资料链接

相关推荐
AlfredZhao18 小时前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80
戴为沐2 天前
Linux内存扩容指南
linux
zylyehuo2 天前
Linux 彻底且安全地删除文件
linux
用户805533698033 天前
主线 U-Boot 上 RK3506:和闭源 rkbin 拔河的三个隐性契约
linux·嵌入式
用户034095297913 天前
linux fcitx 5 雾凇拼音 设置在中文输入法下仍然输入英文标点
linux
乘云数字DATABUFF3 天前
5分钟部署开源APM Databuff:OpenTelemetry全链路追踪入门实战
运维·后端
Web3探索者5 天前
可视化服务器管理和传统命令行区别是什么?新手教程:Linux 运维到底该用图形界面还是 SSH 命令行?
linux·ssh
zylyehuo5 天前
Linux系统中网线与USB网络共享冲突
linux
荣--5 天前
一键部署不是为了省时间 —— 它是把"买来的 PaaS"变成"自己的平台"的拐点
运维·zabbix·工程化·一键部署·平台化·边界设计
江华森5 天前
动手实战学 Docker — 从零到集群编排完全指南
运维