How to compile and install OpenSSH binary on Linux

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
Overview:
OpenSSH (also known as OpenBSD Secure Shell) is a suite of secure networking utilities based on the Secure Shell (SSH) protocol, which provides a secure channel over an unsecured network in a client–server architecture. (from Wikipedia)
OpenSSH is not a single computer program, but rather a suite of programs that serve as alternatives to unencrypted protocols like Telnet and FTP.
Sometimes you need to have a newer or older version of OpenSSH installed on your system. This article shows how to do it manually by downloading and compiling the source code.
Installation was tested on Ubuntu 20.04 system
Installation:
- To check your current installed version of OpenSSH use:
ssh -V - Update repository and download required dependencies:
sudo apt update sudo apt install build-essential zlib1g-dev libssl-dev - Download the OpenSSH source code from here:
The latest version as of writing is 9.1p1wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-[version].tar.gzwget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz - Unarchive the source code files:
tar -xzf openssh-9.1p1.tar.gz cd openssh-9.1p1/ - To check all custom configurable options use:
./configure -h - To install with default options use:
./configure make sudo make install - Example of installation with specific options:
./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh - Check the installation:
ssh -V





