随笔 - 746  文章 - 0  评论 - 39  阅读 - 79万

centos7:编译升级 openssh:主要参考“https://github.com/boypt/openssh-rpms”

参考“https://github.com/boypt/openssh-rpms” 

  “Releases · boypt/openssh-rpms (github.com)

 

安装人家大牛的文档来操作即可。

可选的,自行定制 version.env, 可进行各种组合!

 

复制代码
Backport OpenSSH RPM / SRPM for old CentOS
A simple script to build latest OpenSSH backport RPMs for older CentOS/RHEL distros.

Similar Project: Backport OpenSSH for Debian / Ubuntu distros

Supported (tested) Distro:
CentOS 5/6/7/8/Stream 8
Amazon Linux 1/2/2023
UnionTech OS Server 20
openEuler 22.03 (LTS-SP1)
AnolisOS 7.9/8.6
Current Version:
OpenSSH 9.7p1 (see: OpenSSH Official)
OpenSSL 3.0.13 / 3.0.9 (FIPS validated, see: OpenSSL Official)
The build script reads version.env for actual version definitions.

Build Requirements:
yum groupinstall -y "Development Tools"
yum install -y imake rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel perl perl-IPC-Cmd

# For CentOS5 only:
yum install -y gcc44
Usage
Build RPMs
Install build requirements listed above.
Edit version.env file if necessary.
Download source packages.
./pullsrc.sh
if any error comes up, manally download the source files into the downloads dir. 4. Run the script to build RPMs.

./compile.sh
Install RPMs
# Go go the generated RPMS directory.
cd $(./compile.sh RPMDIR)
pwd
ls
# you will find multiple RPM files in this directory.
# you may copy them to other machines, and continue following steps there.

# Backup current SSH config
[[ -f /etc/ssh/sshd_config ]] && mv /etc/ssh/sshd_config /etc/ssh/sshd_config.$(date +%Y%m%d)

# Install rpm packages. Exclude all debug packages.
find . ! -name '*debug*' -name '*.rpm' | xargs sudo yum --disablerepo=* localinstall -y

# in case host key files got permissions too open.
chmod -v 600 /etc/ssh/ssh_host_*_key

# For CentOS7+:
# in some cases previously installed systemd unit file is left on disk after upgrade.
# causes systemd mixing unit files and initscripts units provided by this package.
if [[ -d /run/systemd/system && -f /usr/lib/systemd/system/sshd.service ]]; then
    mv /usr/lib/systemd/system/sshd.service /usr/lib/systemd/system/sshd.service.$(date +%Y%m%d)
    systemctl daemon-reload
fi

# Check Installed version:
ssh -V && /usr/sbin/sshd -V

# Restart service
service sshd restart
DO NOT DISCONNECET current ssh shell yet, open a NEW shell and login to you machine to verify that sshd is working properly.

Trouble shoot
You may get complains during the yum localinstall process. It's mostly because some subpackages depend on the main openssh package, upgrading only the main package won't fit in their dependencies.

Commonly these packages are needed to be erased before installing built RPMs.

yum erase openssh-askpass openssh-keycat openssh-cavs openssh-askpass openssh-askpass-gnome openssh-debuginfo
If still not satisfied, you may try the final wepon: FORCED INSTALL.

rpm -ivh --force --nodeps --replacepkgs --replacefiles openssh-*.rpm
Use Docker
See file docker.README.md
复制代码

 

#-------------------------------------------------------------------------------------------------------

安装编译完的rpm包方面,主要就是千万不要轻易的断开当前的ssh客户端连接,当然,如果是在控制台上操作,随便!

 

posted on   jinzhenshui  阅读(103)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
历史上的今天:
2023-04-07 FastCFS:再谈 选主 与 过半写
2023-04-07 FastCFS:FastVote-server的作用、使用的时机
2023-04-07 FastCFS:FastDir-server、FastStore-server等服务器组件中的【[server-$id]】的多网卡多ip、单网卡不同port的精细配置
2022-04-07 Windows Server:DHCP 服务:一点总结
2022-04-07 由学习windows server 的 DHCP 服务功能引申学习汇总的一张图
2010-04-07 Sqlserver:代理作业调度的时间不准确.作业停止问题

点击右上角即可分享
微信分享提示