红帽系列离线升级 OpenSSH
声明此文档只应用于CentOS 6.x、CentOS 7.x及RedHat 6.x、RedHat 7.x 其它操作系统升级OpenSSh请自行测试。升级失败可能会导致业务受到影响影响范围请根据业务自行评估。已知受到的影响有: scpsftpssh等注意升级版本之前请保证telnet或vnc开启并保持端口常开如有防火墙配置请自行放行telnet及vnc端口升级前确定telnet及vnc服务可以正常使用1.安装包准备名称版本zlib1.3.2OpenSSL1.1.1wOpenSSH10.4p12.安装必要的依赖包[rootlocalhost ~]# yum -y install wget gcc make perl pam-devel libselinux-develOpenSSH下载地址OpenSSHOpenSSL下载地址OpenSSLZlib下载地址Zlib上传 zlib、OpenSSL、OpenSSH 至 /opt 目录下3.安装 zlib 1.3.2[rootlocalhost ~]# cd /opt[rootlocalhost opt]# tar -xf zlib-1.3.2.tar.gz[rootlocalhost opt]# cd zlib-1.3.2[rootlocalhost zlib-1.3.2]# ./configure --prefix/usr/local/zlib --libdir/lib64[rootlocalhost zlib-1.3.2]# make -j cat /proc/cpuinfo|grep processor|wc -l[rootlocalhost zlib-1.3.2]# make install4.安装 OpenSSL 1.1.1.w[rootlocalhost ~]# cd /opt/[rootlocalhost opt]# tar -xf openssl-1.1.1w.tar.gz[rootlocalhost opt]# cd openssl-1.1.1w/[rootlocalhost openssl-1.1.1w]# ./config --prefix/usr/local/openssl shared zlib \--with-zlib-lib/usr/local/zlib/lib\--with-zlib-include/usr/local/zlib/include[rootlocalhost openssl-1.1.1w]# make -j cat /proc/cpuinfo|grep processor|wc -l[rootlocalhost openssl-1.1.1w]# make install[rootlocalhost openssl-1.1.1w]# mv -f /usr/bin/openssl /usr/bin/openssl.bak[rootlocalhost openssl-1.1.1w]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl[rootlocalhost openssl-1.1.1w]# mv -f /usr/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1.bak[rootlocalhost openssl-1.1.1w]# ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1[rootlocalhost openssl-1.1.1w]# mv -f /usr/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1.bak[rootlocalhost openssl-1.1.1q]# ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1[rootlocalhost openssl-1.1.1q]# vim /etc/ld.so.conf[rootlocalhost openssl-1.1.1q]# cat /etc/ld.so.confinclude ld.so.conf.d/*.conf /usr/local/openssl/lib[rootlocalhost openssl-1.1.1q]# ldconfig[rootlocalhost openssl-1.1.1q]# openssl version5.安装 OpenSSH 10.4p1[rootlocalhost ~]# rpm -qa |grep openssh |xargs rpm -e --nodeps[rootlocalhost ~]# mv /usr/bin/ssh /usr/bin/ssh.bak[rootlocalhost ~]# mv /usr/sbin/sshd /usr/sbin/sshd.bak[rootlocalhost ~]# mv /etc/ssh/ /etc/ssh.bak[rootlocalhost ~]# cd /opt/[rootlocalhost opt]# tar -zxvf openssh-10.3p1.tar.gz[rootlocalhost opt]# cd openssh-10.3p1[rootlocalhost openssh-10.4p1]# ./configure --prefix/usr/local/openssh \--sysconfdir/etc/ssh\--with-ssl-dir/usr/local/openssl\--with-zlib/usr/local/zlib\--with-pam\--with-md5-passwords\--without-hardening\--with-ldflags[rootlocalhost openssh-10.4p1]# make -j cat /proc/cpuinfo|grep processor|wc -l[rootlocalhost openssh-10.4p1]# make isntall[rootlocalhost openssh-10.4p1]# ln -s /usr/local/openssh/sbin/sshd /usr/sbin/sshd[rootlocalhost openssh-10.4p1]# ln -s /usr/local/openssh/bin/ssh /usr/bin/ssh[rootlocalhost openssh-10.4p1]# rm -rf /usr/bin/scp[rootlocalhost openssh-10.4p1]# ln -s /usr/local/openssh/bin/scp /usr/bin/scp[rootlocalhost openssh-10.4p1]# rm -rf /usr/bin/ssh-keygen /usr/bin/ssh-keygen[rootlocalhost openssh-10.4p1]# ln -s /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen[rootlocalhost openssh-10.4p1]# rm -rf /etc/init.d/sshd[rootlocalhost openssh-10.4p1]# rm -rf /usr/lib/system/system/sshd.servece[rootlocalhost openssh-10.4p1]# cat EOF /etc/systemd/system/sshd.service[Unit]DescriptionOpenSSH server daemonDocumentationman:sshd(8)man:sshd_config(5)Afternetwork.target sshd-keygen.serviceWantssshd-keygen.service[Service]TypenotifyEnvironmentFile-/etc/sysconfig/sshdExecStart/usr/local/openssh/sbin/sshd-D$OPTIONSExecReload/bin/kill-HUP$MAINPIDKillModeprocessRestarton-failureRestartSec42s[Install]WantedBymulti-user.target EOF[rootlocalhost openssh-10.4p1]# systemctl daemon-reload[rootlocalhost openssh-10.4p1]# systemctl restart sshd[rootlocalhost openssh-10.4p1]# systemctl enable sshd[rootlocalhost openssh-10.4p1]#sed -i $aCiphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc\nMACs hmac-md5,hmac-sha1,umac-64openssh.com,hmac-sha1-96,hmac-md5-96\nKexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256libssh.org /etc/ssh/sshd_config[rootlocalhost openssh-10.4p1]# sed -i /PermitRootLogin/s/^#//g /etc/ssh/sshd_config[rootlocalhost openssh-10.4p1]# sed -i s/^PermitRootLogin.*/PermitRootLogin yes/ /etc/ssh/sshd_config[rootlocalhost openssh-10.4p1]# sed -i s/^#\?Port .*/Port 10022/ /etc/ssh/sshd_config[rootlocalhost openssh-10.4p1]# chmod 400 /etc/ssh/ssh_*_key[rootlocalhost openssh-10.4p1]# ssh -V

相关新闻

如何快速部署Sentora Core:从安装到配置的完整教程

如何快速部署Sentora Core:从安装到配置的完整教程

如何快速部署Sentora Core:从安装到配置的完整教程 【免费下载链接】sentora-core Sentora is a web hosting control panel written in PHP for *NIX 项目地址: https://gitcode.com/gh_mirrors/se/sentora-core Sentora Core是一款基于PHP开发的开源Web托管…

2026/8/10 19:27:06 阅读更多 →
iOS开发 Swift 速记6:枚举(超复杂)

iOS开发 Swift 速记6:枚举(超复杂)

初级代码游戏的专栏介绍与文章目录-CSDN博客 我的github:codetoys,所有代码都将会位于ctfc库中。已经放入库中我会指出在库中的位置。 这些代码大部分以Linux为目标但部分代码是纯C的,可以在任何平台上使用。 源码指引:github源…

2026/8/10 19:27:06 阅读更多 →
iOS开发 Swift 速记7:结构体和类

iOS开发 Swift 速记7:结构体和类

初级代码游戏的专栏介绍与文章目录-CSDN博客 我的github:codetoys,所有代码都将会位于ctfc库中。已经放入库中我会指出在库中的位置。 这些代码大部分以Linux为目标但部分代码是纯C的,可以在任何平台上使用。 源码指引:github源…

2026/8/10 19:27:06 阅读更多 →

最新新闻

Fan Control终极指南:5分钟掌握Windows风扇控制技巧

Fan Control终极指南:5分钟掌握Windows风扇控制技巧

Fan Control终极指南:5分钟掌握Windows风扇控制技巧 【免费下载链接】FanControl.Releases This is the release repository for Fan Control, a highly customizable fan controlling software for Windows. 项目地址: https://gitcode.com/GitHub_Trending/fa/F…

2026/8/10 22:46:19 阅读更多 →
WeKnora:5分钟快速上手的终极RAG智能文档处理框架,彻底告别信息碎片化

WeKnora:5分钟快速上手的终极RAG智能文档处理框架,彻底告别信息碎片化

WeKnora:5分钟快速上手的终极RAG智能文档处理框架,彻底告别信息碎片化 【免费下载链接】WeKnora Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki. 项目地…

2026/8/10 22:46:19 阅读更多 →
3步构建大麦自动抢票系统:告别手动抢票的终极指南

3步构建大麦自动抢票系统:告别手动抢票的终极指南

3步构建大麦自动抢票系统:告别手动抢票的终极指南 【免费下载链接】ticket-purchase 大麦自动抢票,支持人员、城市、日期场次、价格选择 项目地址: https://gitcode.com/GitHub_Trending/ti/ticket-purchase 还在为抢不到演唱会门票而烦恼吗&…

2026/8/10 22:46:19 阅读更多 →
KernelSU WebUI终极指南:让Android模块管理像打开网页一样简单

KernelSU WebUI终极指南:让Android模块管理像打开网页一样简单

KernelSU WebUI终极指南:让Android模块管理像打开网页一样简单 【免费下载链接】KernelSU A Kernel based root solution for Android 项目地址: https://gitcode.com/GitHub_Trending/ke/KernelSU 你是否曾因Android模块配置的复杂性而感到困惑?…

2026/8/10 22:46:19 阅读更多 →
从js闭包谈到作用域、作用域链、执行上下文、内存管理

从js闭包谈到作用域、作用域链、执行上下文、内存管理

文章目录 作用域 函数作用域和全局作用域 块级作用域和暂时性死区 执行上下文和调用栈 代码执行的两个阶段 调用栈 闭包 内存管理 内存泄漏场景举例 浏览器垃圾回收 如何避免内存泄漏 如何利用闭包实现单例模式 ✍创作者:全栈弄潮儿 🏡 个人主页: 全栈弄潮儿的个人主页 🏙…

2026/8/10 22:46:19 阅读更多 →
Pock:重新定义MacBook Touch Bar的小部件管理器

Pock:重新定义MacBook Touch Bar的小部件管理器

Pock:重新定义MacBook Touch Bar的小部件管理器 【免费下载链接】pock Widgets manager for MacBook Touch Bar 项目地址: https://gitcode.com/gh_mirrors/po/pock Pock是一款专为MacBook Touch Bar设计的开源小部件管理器,它彻底改变了Touch Ba…

2026/8/10 22:45:18 阅读更多 →

日新闻

GraphQL-CSS API全解析:useGqlCSS、GqlCSS组件与getStyles实用指南

GraphQL-CSS API全解析:useGqlCSS、GqlCSS组件与getStyles实用指南

GraphQL-CSS API全解析:useGqlCSS、GqlCSS组件与getStyles实用指南 【免费下载链接】graphql-css A blazing fast CSS-in-GQL™ library. 项目地址: https://gitcode.com/gh_mirrors/gr/graphql-css GraphQL-CSS是一个基于GraphQL的CSS-in-GQL™库&#xff0…

2026/8/10 0:00:02 阅读更多 →
告别语言障碍:KISS Translator 双语翻译插件终极指南

告别语言障碍:KISS Translator 双语翻译插件终极指南

告别语言障碍:KISS Translator 双语翻译插件终极指南 【免费下载链接】kiss-translator A simple, open source bilingual translation extension & Greasemonkey script (一个简约、开源的 双语对照翻译扩展 & 油猴脚本) 项目地址: https://gitcode.com/…

2026/8/10 0:00:02 阅读更多 →
BepInEx配置管理器:游戏插件配置的终极可视化解决方案

BepInEx配置管理器:游戏插件配置的终极可视化解决方案

BepInEx配置管理器:游戏插件配置的终极可视化解决方案 【免费下载链接】BepInEx.ConfigurationManager Plugin configuration manager for BepInEx 项目地址: https://gitcode.com/gh_mirrors/be/BepInEx.ConfigurationManager 你是否曾经因为游戏插件的复杂…

2026/8/10 0:00:02 阅读更多 →

周新闻

5分钟告别提取码焦虑:baidupankey如何智能破解百度网盘资源锁

5分钟告别提取码焦虑:baidupankey如何智能破解百度网盘资源锁

5分钟告别提取码焦虑:baidupankey如何智能破解百度网盘资源锁 【免费下载链接】baidupankey 在线查询网盘提取码(维护中 rm repo) 项目地址: https://gitcode.com/gh_mirrors/ba/baidupankey 你是否曾经在深夜寻找一份重要资料&#x…

2026/8/10 1:05:29 阅读更多 →
如何快速生成中国车牌图片:Python开源工具完整指南

如何快速生成中国车牌图片:Python开源工具完整指南

如何快速生成中国车牌图片:Python开源工具完整指南 【免费下载链接】chinese_license_plate_generator 中国车牌生成器 项目地址: https://gitcode.com/gh_mirrors/ch/chinese_license_plate_generator 中国车牌生成器是一个基于Python的开源项目&#xff0c…

2026/8/10 1:05:29 阅读更多 →
收藏!小白程序员轻松入门大模型,从Harness工程开始实践

收藏!小白程序员轻松入门大模型,从Harness工程开始实践

文章强调学习大模型不应只关注模型本身,而应重视模型外的系统搭建,即Harness。提出AgentModelHarness的实用公式,详细介绍Harness的四个层次:持久化层、执行层、控制层和观察与验证层。文章还探讨了上下文工程、工具设计、AGENTS.…

2026/8/10 1:05:29 阅读更多 →

月新闻

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南

免费解锁百度网盘SVIP加速:macOS用户必备的下载提速终极指南 【免费下载链接】BaiduNetdiskPlugin-macOS For macOS.百度网盘 破解SVIP、下载速度限制~ 项目地址: https://gitcode.com/gh_mirrors/ba/BaiduNetdiskPlugin-macOS 还在为百度网盘macOS版的龟速下…

2026/8/10 17:07:33 阅读更多 →
终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换

终极ncmdump指南:3分钟实现网易云NCM音乐解密与格式转换 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 还在为网易云音乐下载的NCM格式文件无法在其他播放器播放而烦恼吗?ncmdump解密工具帮你轻松解决这个困…

2026/8/10 1:05:29 阅读更多 →
HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

HarmonyOS 应用开发《掌上英语》第81篇: 智能体卡片:为英语学习 App 打造桌面级学习助手

AgentCard 智能体卡片:为英语学习 App 打造桌面级学习助手适用平台:HarmonyOS 7.0 (API 26 Beta)一、引言 HarmonyOS 7.0(API 26 Beta)新增了 AgentCard 智能体卡片能力,这是继 HMAF(鸿蒙智能体框架&#x…

2026/8/10 17:07:33 阅读更多 →