Description of problem:
Apparently by default (ssh_trust_dns option true) we set the HostKeyAlgorithms options for ssh in clients to a very restrictive set "ssh-rsa,ssh-dss".
this was done in 2012 to deal with an older version of ssh which did not properly support ecdsa keyex in the SSHFP checking case.
However this option ends up disabling all modern key exchanges (SHA-2/EC) and re-enables a key excahnge that is explicitly disabled in FIPS mode (DSA based).
The main issue though is that because of these options a RHEL-8 client (also RHEL-7) enrolled in IPA is unable to successfully SSH into a RHEL-8 server in FIPS mode, as there is no common set of algorithms left.
This is a high profile issue for any customers that want to use IDm client in a FIPS environment.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
I think this part of code was highly inspired by the bug report in Debian , which recommends these particular configuration options to be set as a workaround of old openssh versions in the frame between 5.7 and 6.1. Neither of these versions is available in neither of RHELs or Fedora anymore and as described above, they are even harmful since they reduce default security configuration of OpenSSH for all (!) connections in following ways:
* ssh-dsa is disabled by default and no scripts should enable it this way. Using 1k DSA keys is purely wrong
* ssh-rsa references to legacy RSA with SHA1, which is being slowly deprecated by rsa-sha2-256 and rsa-sha2-512, which are also disabled by your configuration
* there are ecdsa and ED25519 key types that are being disabled this way also
Please, consider dropping this configuration change  from your install scripts.
The HostKeyAlgorithms setting is only added when ipa-client-install is invoked with --ssh-trust-dns. By default the internal flag trust_sshfp is False and the setting is not added to the global ssh config.
Should IPA use a different setting for HostKeyAlgorithms or not touch HostKeyAlgorithms at all?
Update from internal conversation with Simo and Rob:
It is sufficient to remove the problematic HostKeyAlgorithms stanza from the ssh config file. Since it only affects the global ssh client config file, it is not necessary to restart any service. A simple sed call might be good enough.
Upstream fixed proposed in https://github.com/freeipa/freeipa/pull/3887
Fixed in IPA 4.8.2
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.