下载开源脚本上传到centos7
https://github.com/boypt/openssh-rpms
code -> download zip
解压shell脚本
unzip openssh-rpms-main.zip
el5、el6、el7:对应CentOS5、6、7三个系统,编译相关的参数由SPECS目录下的openssh.spec控制。编译好的rpm包放在RPMS目录下。
pullsrc.sh:openssh相关源码下载脚本
version.env:定义了openssh及openssl源码的版本信息
下载源码包并上传到openssh-rpms-main/downloads
openssl 1.1.1w x11-ssh-askpass-1.2.4.1.tar.gz openssh-9.7p1.tar.gz
https://www.openssl.org/source/old/index.html
https://src.fedoraproject.org/repo/pkgs/openssh/
https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable
准备编译环境
yum groupinstall -y "Development Tools"
yum install -y imake rpm-build pam-devel krb5-devel zlib-devel libXt-devel libX11-devel gtk2-devel
修改version.env源码包修改为相应版本
./compile.sh el7
生成的RPM在openssh-rpms-main/el7/RPMS/x86_64
rpm -Uvh openssh-clients-9.7p1-1.el7.x86_64.rpm openssh-server-9.7p1-1.el7.x86_64.rpm openssh-9.7p1-1.el7.x86_64.rpm
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
systemctl restart sshd