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

网盘资料链接

相关推荐
mounter6259 小时前
从硬件互连到操作系统变革:CXL 技术演进与 Linux 内核工程挑战
linux·运维·服务器
zhengqweasd9 小时前
机房托管服务器怎么选硬盘,机械盘和 SSD 托管场景差异
运维·服务器·github
xh didida10 小时前
Linux -- 基础IO
linux·服务器·开发语言·c++
心易行者11 小时前
Agent应用+API端点商业化进阶实战:从单体智能体到可付费调用的API全流程
运维·服务器·人工智能·python·apache
科技研学社11 小时前
精度决胜品质:羽绒服缝制工艺标准与自动化精度对标解析
运维·自动化
夜之眷属11 小时前
Core dump 崩溃排查:JVM 宕机后,那份 core 文件怎么用 gdb 还原现场
java·运维·服务器·jvm
Initialize2930811 小时前
Redis 内存打满、连接数飙红?运维排查四步法
运维
zly350011 小时前
centos7 mount设备挂载 /dev/sda1/硬盘挂载
linux·运维·服务器
零基础12311 小时前
FinalShell 使用教程:从安装到高效运维
运维·经验分享·笔记·finalshell