Skip to content

Instantly share code, notes, and snippets.

@tjheeta
Last active June 21, 2022 08:12
Show Gist options
  • Save tjheeta/654a246d18fea65b2da0 to your computer and use it in GitHub Desktop.
Save tjheeta/654a246d18fea65b2da0 to your computer and use it in GitHub Desktop.
Build OpenSSH RPM for Centos
sudo yum install -y pam-devel
sudo yum install -y rpm-build
sudo yum install -y zlib-devel
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz.asc
# verify the file
# update the pam ssd from the one included on the system
# the default provided doesn't work properly on centos 6.6
tar zxvf openssh-6.7p1.tar.gz
cp /etc/pam.d/sshd openssh-6.7p1/contrib/redhat/sshd.pam
mv openssh-6.7p1.tar.gz{,.orig}
tar zcpf openssh-6.7p1.tar.gz openssh-6.7p1
cd
tar zxvf ~/rpmbuild/SOURCES/openssh-6.7p1.tar.gz openssh-6.7p1/contrib/redhat/openssh.spec
# edit the specfile
cd openssh-6.7p1/contrib/redhat/
sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" openssh.spec
sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" openssh.spec
sed -i -e "s/BuildPreReq/BuildRequires/g" openssh.spec
rpmbuild -ba openssh.spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment