sshd ignores Ciphers, MACs, and KexAlgorithms in /etc/ssh/sshd_config on RHEL 9
Environment
- Red Hat Enterprise Linux 9
- openssh-server
- crypto-policies
Issue
- On RHEL 9,
sshdignoresCiphers,MACs, andKexAlgorithmsin/etc/ssh/sshd_config, along with thecrypto-policiessystem opt-outCRYPTO_POLICY=line in/etc/sysconfig/sshd.
Resolution
-
Make a new
/etc/ssh/sshd_config.d/49-crypto-policy-override.conffile and migrate over any configuration for the following keywords in/etc/ssh/sshd_config:CASignatureAlgorithms Ciphers GSSAPIKexAlgorithms GSSAPIKeyExchange HostKeyAlgorithms KexAlgorithms MACs PubkeyAcceptedAlgorithms RequiredRSASize
Root Cause
-
Opt-out configuration for
crypto-policiesis different in RHEL 8 and RHEL 9.- The
CRYPTO_POLICY=line in/etc/sysconfig/sshdis ignored in RHEL 9. - RHEL 9 opt-out configuration is described in Examples of opting out of system-wide crypto policies
- The
-
opensshuses the first instance of a keyword. Any later occurrence is ignored. After/etc/crypto-policies/back-ends/opensshserver.configis included, any instances of the same keywords in/etc/ssh/sshd_configare ignored.
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.