15

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 
8
  • How did you "try to install"?
    – Pilot6
    Commented Nov 18, 2019 at 11:20
  • 3
    And why do you need 8.0. Ubuntu 18.04 has 1.7.6p1 with security updates.
    – Pilot6
    Commented Nov 18, 2019 at 11:22
  • 1
    PCI complaints fails due to openssh username enumeration vulnerability
    – Vinoth Rc
    Commented Nov 18, 2019 at 13:56
  • 3
    you mistyped the command, it's openssh-server instead of openssl-server
    – damadam
    Commented Nov 18, 2019 at 15:42
  • 1
    So were you able to upgarde openssh to OpenSSH8.0p1 on Ubuntu 18.04?
    – karmendra
    Commented Jul 7, 2020 at 20:15

4 Answers 4

22

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).

Check new version

Locally

Open a new terminal and run:

$ ssh -V
OpenSSH_8.9p1, OpenSSL 1.1.1  11 Sep 2018

Remote

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.

Online

Use sshcheck.com to check the version.

9
  • My Ubuntu 18.04 LTS base install ($ ssh -V : OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017) gave warning after upgrade (to: $ ssh -V : OpenSSH_8.0p1, OpenSSL 1.1.1g 21 Apr 2020) with the mesage: "/etc/ssh/ssh_config line 51: Unsupported option "gssapiauthentication"" -> Kerberos missing, add --with-kerberos5 to ./configure line.
    – hakre
    Commented Sep 11, 2020 at 18:42
  • @hakre I then got an error "auth.h:40:18: fatal error: krb5.h: No such file or directory" - how did you solve this? Commented Mar 9, 2021 at 10:46
  • 2
    @AntonyD'Andrea: The message sounds like the sources are missing, try to first apt install libkrb5-dev and then ./configure ... + make again (or only make as it should be already configured from last run).
    – hakre
    Commented Mar 9, 2021 at 12:04
  • ssh -V: "OpenSSH_8.5p1", telnet the.host: "OpenSSH_6.6.1p1". Since init.d script doesn't use /usr/local/sbin. How to properly replace distrib binary ? Commented Mar 22, 2021 at 13:35
  • When I get to the make step the output says "make: *** No targets specified and no makefile found. Stop." If I proceed, the upgrade doesn't work. ssh -V still shows the old version.
    – arnoldbird
    Commented Mar 24, 2021 at 14:23
4

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.

4
  • sudo apt install openssl-server Reading package lists... Done <br/> Building dependency tree <br/> Reading state information... Done<br/> E: Unable to locate package openssl-server <br/>
    – Vinoth Rc
    Commented Nov 18, 2019 at 13:59
  • 2
    You are using Ubuntu 19.10 that has the 1.8.0 version, but 18.04 is still on 1.7.6.
    – Pilot6
    Commented Nov 18, 2019 at 15:23
  • 1
    @VinothRc You probably don't use multiverse repo.
    – Pilot6
    Commented Nov 18, 2019 at 15:24
  • @Pilot6 Thanks a lot
    – Vinoth Rc
    Commented Nov 19, 2019 at 7:09
2

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.

1
  • Directory: /usr/sbin/ Commands: mv sshd sshd.bak cp /usr/local/sbin/sshd sshd works for me
    – devugur
    Commented May 13, 2022 at 13:42
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .