Skip to content

Instantly share code, notes, and snippets.

@jfinstrom
Last active March 12, 2024 17:13
Show Gist options
  • Save jfinstrom/b422727069384b9e71672973a0605bce to your computer and use it in GitHub Desktop.
Save jfinstrom/b422727069384b9e71672973a0605bce to your computer and use it in GitHub Desktop.
Updating openssh on Centos 7

Compiling and Installing OpenSSH 9.0p1 on CentOS 7

Instructions:

  1. Download the Source Code:

    wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
  2. Extract the Archive:

    tar -xzvf openssh-9.0p1.tar.gz
  3. Change Directory:

    cd openssh-9.0p1/
  4. Install Dependencies (Example for CentOS/RHEL):

    yum groupinstall 'Development Tools'
    yum install -y pam-devel libselinux-devel zlib-devel openssl-devel
  5. Configure the Build:

    ./configure --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
  6. Compile the Source Code:

    make
  7. Install OpenSSH:

    make install
  8. Set Permissions on Key Files:

    chmod 0600 /etc/ssh/ssh_host_rsa_key
    chmod 0600 /etc/ssh/ssh_host_ecdsa_key
    chmod 0600 /etc/ssh/ssh_host_ed25519_key
  9. Disable GSSAPI Options (If Needed):

    sed -i -e '/^GSSAPIAuthentication/ s/^/#/' -e '/^GSSAPICleanupCredentials/ s/^/#/' /etc/ssh/sshd_config
  10. Restart the SSH Service:

    sudo systemctl restart sshd
  11. Verify Installation:

    ssh -V
  12. ???

  13. profit

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