Skip to content

Instantly share code, notes, and snippets.

@hoangdh
Created May 17, 2024 07:02
Show Gist options
  • Save hoangdh/ad141d9bff730c4d32a83c507db91128 to your computer and use it in GitHub Desktop.
Save hoangdh/ad141d9bff730c4d32a83c507db91128 to your computer and use it in GitHub Desktop.
Compile OpenSSH 9.3p2 from Source code

CVE: https://ubuntu.com/security/CVE-2023-38408

Run it

#!/bin/bash

WORK_DIR=/opt
mkdir -p /var/lib/sshd/
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bk

apt-get install -y zlib1g-dev libpam0g-dev libselinux1-dev build-essential libssl-dev libselinux1-dev

curl -sL https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p2.tar.gz | tar -C ${WORK_DIR} -xvzf -
mkdir -p /var/lib/sshd/
cd ${WORK_DIR}/openssh-9.3p2  && ./configure --prefix=/usr/ \
--with-pam \
--with-selinux \
--with-privsep-path=/var/lib/sshd/ \
--sysconfdir=/etc/ssh

make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment