RHEL-10-700640 - RHEL 10 must not allow users to override Secure Shell (SSH) environment variables.

Information

SSH environment options potentially allow users to bypass access restriction in some configurations.

OpenSSH uses the first occurrence of a keyword it sees, and drop-in files are read in lexicographical order at the start of the configuration. Red Hat recommends using drop-in files rather than changing base configuration files.

Solution

Configure RHEL 10 to disable unattended or automatic login via SSH.

In "/etc/ssh/sshd_config.d", create a drop file that will lexicographically precede 50-redhat.conf and add the following line:

PermitUserEnvironment no

Restart the SSH daemon with the following command for the setting to take effect:

$ sudo systemctl restart sshd.service

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_RHEL_10_V1R1_STIG.zip

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7a., CAT|I, CCI|CCI-000381, Rule-ID|SV-281267r1184767_rule, STIG-ID|RHEL-10-700640, Vuln-ID|V-281267

Plugin: Unix

Control ID: 9cd727e123beee3a1ba6266c90dc1318064b53514d26c34784ce1a8bf44e1e42