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

网盘资料链接

相关推荐
我先去打把游戏先1 小时前
【保姆级图文教程】:VMware虚拟机安装Ubuntu Server 22.04
linux·数据库·ubuntu
IpdataCloud1 小时前
企业级IP定位服务准确率怎么保证?从数据源到离线库的精度提升指南
运维·服务器·网络·数据库·tcp/ip
treesforest1 小时前
从IP地址归属地查询到IP地理位置精准查询指南
服务器·前端·网络
派葛穆1 小时前
Ubuntu-软件安装和执行
linux·运维·ubuntu
AlickLbc2 小时前
WSL2安装Ubuntu与Claude Code记录
linux·运维·ubuntu
青天喵喵2 小时前
Linux WiFi 架构解析:连接流程(基础篇二)
linux·运维·架构·嵌入式·wi-fi·sta·ap
Bug-制造者2 小时前
正则表达式 vs Shell通配符:彻底分清,告别命令行踩坑
linux·正则表达式
雨的旋律20992 小时前
linux网卡绑定bond设置一步不少
linux·运维·网络
OpenAnolis小助手2 小时前
Anolis OS Linux Dirty Frag 漏洞安全声明
linux·安全·web安全·龙蜥社区