Skip to content

Instantly share code, notes, and snippets.

@FalconIA
Last active July 13, 2024 11:41
Show Gist options
  • Save FalconIA/42d7b44ff3872be32e946de7182c21c4 to your computer and use it in GitHub Desktop.
Save FalconIA/42d7b44ff3872be32e946de7182c21c4 to your computer and use it in GitHub Desktop.

BCLinux U8 Build OpenSSH 9.8p1 RPM package

Remove bclinux-license-manager

rpm -qa | grep bclinux-license-manager | xargs sudo rpm -evh

Build OpenSSH RPM

Prepare build tools

sudo dnf install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel libXt-devel gtk2-devel make perl -y

wget https://vault.centos.org/8-stream/PowerTools/x86_64/os/Packages/imake-1.0.7-11.el8.x86_64.rpm
sudo dnf localinstall imake-1.0.7-11.el8.x86_64.rpm

Build

mkdir -p ~/rpmbuild/{SOURCES,SPECS}
cd ~/rpmbuild/SOURCES
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.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
tar -zxf openssh-9.8p1.tar.gz
cp openssh-9.8p1/contrib/redhat/openssh.spec ~/rpmbuild/SPECS/
cd ~/rpmbuild/SPECS/
rpmbuild -ba --define "static_openssl 1" openssh.spec
cd ~/rpmbuild/RPMS/x86_64/

Upgrade OpenSSH

Check current OpenSSH version

rpm -qa | grep openssh

Backup sshd config

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.$(date +'%Y%m%d')

Install

cd ~/rpmbuild/RPMS/x86_64/
sudo dnf localinstall openssh-9.8p1-1.el8.bclinux.x86_64.rpm openssh-clients-9.8p1-1.el8.bclinux.x86_64.rpm openssh-server-9.8p1-1.el8.bclinux.x86_64.rpm -y

Verify

ssh -V
rpm -qa | grep openssh

Result:

OpenSSH_9.8p1, without OpenSSL

openssh-9.8p1-1.el8.bclinux.x86_64
openssh-server-9.8p1-1.el8.bclinux.x86_64
openssh-clients-9.8p1-1.el8.bclinux.x86_64

Restart service

sudo chmod 0600 /etc/ssh/ssh_host_*_key
sudo systemctl restart sshd
sudo systemctl status sshd

Clean

rm -fr ~/rpmbuild/BUILD/ ~/rpmbuild/BUILDROOT/ ~/rpmbuild/SOURCES/openssh-9.8p1/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment