SSH is not working after the upgrade from RHEL7 to RHEL8

Solution Verified - Updated -

Environment

  • RHEL 7
  • RHEL 8
  • openssh

Issue

  • ssh -V returns incorrect (older) openssh version after the upgrade from RHEL7 to RHEL8.
  • SSH is failing with following error, despite configuration being correct.
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
/etc/ssh/ssh_config: line 52: Bad configuration option: include
/etc/ssh/ssh_config: terminating, 1 bad configuration options

Resolution

  1. Manually download the version listed in the rpm database and do a forced install.
$ mkdir /tmp/openssh
$ cd /tmp/openssh
  • Use yumdownloader command provided by yum-utils package.
# yum install yum-utils

# yumdownloader openssh-8.0p1-19.el8_8.x86_64 \
        openssh-clients-8.0p1-19.el8_8.x86_64 openssh-server-8.0p1-19.el8_8.x86_64

# rpm -i --force ./openssh-8.0p1-19.el8_8.x86_64.rpm \
        ./openssh-clients-8.0p1-19.el8_8.x86_64.rpm ./openssh-server-8.0p1-19.el8_8.x86_64.rpm

NOTE: Above package versions are just for example. You need to replace above rpms with the downloaded rpms.

  1. Verify the packages again
rpm -V openssh openssh-clients openssh-server

Root Cause

  • The binaries at /usr/bin/ssh is not the one from the package that is identified in the rpm database, namely openssh-clients-8.0p1-19.el8_8.x86_64 (from above example). It would appear to still be an early RHEL 7 version and the upgrade would appear to have failed.

Diagnostic Steps

  1. SSH fails with below error
$ ssh -vvv <user>@<IP_address>
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
/etc/ssh/ssh_config: line 52: Bad configuration option: include
/etc/ssh/ssh_config: terminating, 1 bad configuration options
  1. Verify the package version via the following
rpm -V openssh openssh-clients openssh-server

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments