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

网盘资料链接

相关推荐
ltl5 小时前
内核追踪:ftrace、kprobe、uprobe、tracepoint 生产实战
linux
·薯条大王6 小时前
经济实惠玩云服务器|一台云服务器多人共用,子账号配置教程
java·linux·运维·服务器·汇编·c++·python
ZJH__GO9 小时前
网络编程v4pro--实现聊天室文件传输功能
java·服务器·网络·计算机网络
小小、码农9 小时前
Linux进程控制:从fork到exec,手写一个简易Shell
linux·运维·服务器
不会就选b9 小时前
Linux之进程间通信(二)---模拟进程池
linux·运维·服务器
NeilYuen10 小时前
用UDP实现向DNS服务器请求IP地址
服务器·tcp/ip·udp
沫璃染墨11 小时前
《从零入门Linux系统篇(十五):系统工具篇·六——GDB调试器详解:从程序执行控制到高级调试技巧》
linux·运维·服务器·c语言·c++
AIgorithmGEEK12 小时前
Linux 环境变量完全指南:从入门到理解底层原理
linux·运维·服务器
修罗王12 小时前
Linux Docker 服务管理与排查实战指南(新手速查版)
运维·docker
迪康Defender12 小时前
从静态存储到动态流转:终端透明加密两种模式实战解析
运维·服务器·网络·数据库·其他