尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
红帽系列离线升级 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
RELATED

相关推荐

如何快速部署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/10/13 15:17:32
iOS开发 Swift 速记6:枚举(超复杂)

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

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

📅 2026/10/8 13:55:35
iOS开发 Swift 速记7:结构体和类

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

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

📅 2026/10/11 8:23:29
MORE NEWS

更多资讯

📰

企业AI知识库落地实战:知识治理与场景嵌入决定成败

1. 同样部署AI知识库,为什么有的企业提升效率,有的上线即闲置?我前后参与过七八个企业级AI知识库的落地项目,有制造业的设备维修知识库,有互联网公司的客服辅助系统,也有律所的内部法规检索工具。说实话&am…

📰

CEEMD互补集合经验模态分解:原理、源码与参数实践

简介:这一源代码包面向从事非线性、非平稳信号处理的研究者与工程师,提供CEEMD(完全集合经验模态分解)的完整Matlab实现。相比传统EMD,CEEMD通过添加随机白噪声并进行多次分解平均,有效缓解模式混合与虚假极…

📰

存储重构终端算力:端侧AI推理的带宽、容量与加载优化

之前在给一台端侧AI原型机做性能摸底时,遇到过很典型的场景:芯片标称的NPU算力接近几十TOPS,纸面数据非常漂亮,但真拿它跑一个7B规模的端侧对话模型,生成速度却死活上不去。端侧AI加速这几年一直在强调算力&#xff0c…

📰

大模型后训练实战:从SFT到RLHF的避坑指南

1. 为什么2025年的模型差距几乎都出在后训练环节 2025年6月,我负责的模拟项目X-助手又翻车了——基础能力评测全线飘绿,一到真实多轮对话里就东拉西扯,用户问退货运费,它先给你讲半小时消费者权益法。团队第一反应是"预训练数…

📰

欧拉路径与哈密顿路径难题:DeepSeek-V4-Pro 在图论遍历路径判定上的逻辑表现

国庆长假后教研室的服务器集群终于恢复了日常负载,今天上午组会讨论图论与组合优化算法,导师在白板上随手画了一个看似对称却暗藏玄机的有向图,问了一句:“如果每条边只走一次,和每个点只走一次,你们写算法…

📰

基于Python的模拟仪表读数自动识别:DeepLabV3+与霍夫变换实战

简介:这份资源是西安石油大学电子信息专业硕士学位论文《基于Python的模拟仪表读数自动识别系统设计》,面向从事工业巡检、变电站与采油厂自动化改造的开发者及图像处理方向的研究生,针对指针式仪表人工读数效率低、表盘轮廓提取不完整、量程…

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬