CentOS 6 源码制作openssh8.9/9.0/9.1/9.2/9.3 p1 rpm包——筑梦之路

centos 6 制作openssh8.9p1 rpm包

本篇主要就和centos 7制作openssh8.9p1 rpm包做区别,其他内容类似。

https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-8.9p1.tar.gz

openssh.spec文件中

#将改行注释
94 #PreReq: initscripts >= 5.00

解决报错:line 94: prereq is deprecated: PreReq: initscripts >= 5.00

#注释该行
103 #BuildRequires: openssl-devel < 1.1  

#解决报错
install: cannot stat `contrib/redhat/sshd.pam.old': No such file or directory

将源码解压:

cd  openssh-8.9p1/contrib/redhat

拷贝文件

cp sshd.init sshd.init.old  
cp sshd.pam sshd.pam.old

重新打包源码
tar -czf openssh-8.9p1.tar.gz

制作rpm包常用命令

rpmbuild -ba  openssh.spec #制作二进制包和源码包

rpmbuild -bb openssh.spec  #仅制作二进制包

rpmbuild -bs openssh.spec  #仅制作源码包

其他说明:

-bp 只作准备 (解压与打补丁)
-bc 准备并编译
-bi 编译并安装
-bl 检验文件是否齐全
-ba 编译后做成*.rpm和src.rpm
-bb 编译后做成*.rpm
-bs 只做成*.src.rpm 

rpmbuild --target x86_64 可指明目标平台架构

------------------------------------------------------
openssh9.0源码包下载地址:

https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz

制作过程几乎没什么差别

-----------------------------------------------------
openssh9.1源码下载地址:
https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
centos 6 安装升级openssh 9.1 

需要的rpm包:

openssh-9.1p1-1.el6.x86_64.rpm
openssh-clients-9.1p1-1.el6.x86_64.rpm
openssh-server-9.1p1-1.el6.x86_64.rpm

1. 备份现有的配置文件和权限文件

cp -rp /etc/ssh /etc/ssh_backup
cp -rp /etc/pam.d/sshd /etc/pam.d/sshd

2.安装新版本openssh rpm包

yum localinstall *.rpm

3.检查验证安装

rpm -qa | grep openssh

openssh-clients-9.1p1-1.el6.x86_64
openssh-9.1p1-1.el6.x86_64
openssh-server-9.1p1-1.el6.x86_64

#检查ssh版本

ssh -V

OpenSSH_9.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013

4.修改配置、文件权限

cat /etc/pam.d/sshd
#%PAM-1.0
auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
## pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
## pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth


chmod 400 /etc/ssh/ssh_host*

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

5.重启服务验证

service sshd restart 

service sshd status

sshd (pid  12297) 正在运行...



openssh-8.9p1-1.el6.x86_64.tar.gz-网络安全文档类资源-CSDN下载适用于rhel6centos6的openssh8.9p1rpm包,主要用于安全漏洞升级、ope更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/qq_34777982/83378271

openssh-9.0p1-1.el6.x86_64.tar.gz-Linux文档类资源-CSDN下载鉴于市面上还有使用centos6redhat6系列的操作系统作为生产服务器,而安全漏洞问题比较重要更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/qq_34777982/85113295

openssh-9.1p1-1.el6.x86-64.tgz-Linux文档类资源-CSDN下载适用于centos6rhel6版本的操作系统升级安装openssh9.1p1修复安全漏更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/qq_34777982/86793036

参考资料:rpmbuild命令详解 - 夜塔 - 博客园 

你可能感兴趣的:(linux系统运维,centos,linux,运维)