Tried to install OpenSSH_8.0p1 but installed OpenSSh Client only.
sudo apt install openssl-server Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openssl-server
Tried to install OpenSSH_8.0p1 but installed OpenSSh Client only.
sudo apt install openssl-server Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openssl-server
To upgrade OpenSSH from 7.6 to 8.9 on Ubuntu 18.04 (bionic), I followed the instructions given here: How to Install OpenSSH 8.0 Server from Source in Linux.
The version I started with:
$ ssh -V
OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
Here are the commands to upgrade:
sudo apt update
sudo apt install build-essential zlib1g-dev libssl-dev
sudo mkdir /var/lib/sshd
sudo chmod -R 700 /var/lib/sshd/
sudo chown -R root:sys /var/lib/sshd/
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.9p1.tar.gz
tar -xzf openssh-8.9p1.tar.gz
cd openssh-8.9p1/
sudo apt install libpam0g-dev libselinux1-dev libkrb5-dev
./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
make
sudo make install
Restart your machine (without it the remote connections are using the old version).
Open a new terminal and run:
$ ssh -V
OpenSSH_8.9p1, OpenSSL 1.1.1 11 Sep 2018
Check if the OpenSSH version has changed from a remote machine:
$ ssh -v user@ip
Look for a line saying Remote protocol version. It shows the version.
Use sshcheck.com to check the version.
If you search with your apt tool on ubuntu repositories for your version typing apt search openssh you will find the package openssh-server/ubuntu-codename version in green among others packages unrelated to your question.
If this is the version you're looking for (mine shows openssh 1:8.0p11 already), you can install it with sudo apt install openssh-server as you would normally. However, if you can't find it on ubuntu repositories, you could search for it on official repos or even try to compile it from source code.
Edit: @VinohRc, I misstyped openssh, but edited the answer to the correct name. However, as @Pilot6 said, ubuntu 18.04 still dont have 1.8 version.
Also refer to the above answer. I am using Ubuntu 16.x and although ssh -V shows the correct version, telnet keeps showing the old one. After a short search, I found that the sshd service keeps the old version, so I did the following:
sudo cd /usr/sbin
sudo mv sshd sshd.bak # make a copy before overwriting
sudo cp /usr/local/sbin/sshd sshd
Using telnet should now respond with the updated version, but, for safety, a reboot of the server is recommended.
For Ubuntu 20, check your current SSH version;
ssh -V
Then, if you need an upgrade;
sudo apt update
sudo apt install build-essential zlib1g-dev libssl-dev
sudo mkdir /var/lib/sshd
sudo chmod -R 700 /var/lib/sshd/
sudo chown -R root:sys /var/lib/sshd/
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
You can find all versions here.
Then,
tar -xzf openssh-8.8p1.tar.gz
cd openssh-8.8p1/
sudo apt install libpam0g-dev libselinux1-dev libkrb5-dev
./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
make
sudo make install
Check your upgraded version;
ssh -V
OpenSSH_8.8p1, OpenSSL 1.1.1f 31 Mar 2020
If it still shows the old version then copy the new version as below.
sudo cd /usr/sbin
sudo mv sshd sshd.bak # Back up existing
sudo cp /usr/local/sbin/sshd sshd