1.下载 openssh tar包
wget https://mirror.leaseweb.com/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gzhttps://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
下载 x11-ssh-askpass-1.2.4.1.tar.gz 源码包
wget https://src.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3/x11-ssh-askpass-1.2.4.1.tar.gz
2.配置编译打包环境
yum install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel
mkdir -p /root/rpmbuild/SOURCES
mkdir -p /root/rpmbuild/SPECS
cp /root/openssh-8.4p1.tar.gz /root/rpmbuild/SOURCES/
cp /root/x11-ssh-askpass-1.2.4.1.tar.gz /root/rpmbuild/SOURCES/
tar -zxf openssh-8.4p1.tar.gz -C /opt
cp /opt/openssh-8.4p1/contrib/redhat/openssh.spec /root/rpmbuild/SPECS/
chown sshd:sshd /root/rpmbuild/SPECS/openssh.spec
3.修改openssh.spec 并进行打包
vi openssh.spec
将原先openssh.spec中的
%global no_x11_askpass 0
%global no_gnome_askpass 0
修改为
%global no_x11_askpass 1
%global no_gnome_askpass 1
并注释掉#BuildRequires: openssl-devel < 1.1
因为openssl安装的版本都低于1.1
4.进行打包
rpmbuild -ba openssh.spec
cd /root/rpmbuild/RPMS/x86_64