Skip to content

5.1.21 Ensure sshd PermitUserEnvironment is disabled

Audit#

Run the following command to verify PermitUserEnviroment is set to no:

# sshd -T | grep permituserenvironment
permituserenvironment no

Remediation#

Edit the /etc/ssh/sshd_config file to set the PermitUserEnvironment parameter to no above any Include entries as follows:

PermitUserEnvironment no
Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location.

Default Value: PermitUserEnvironment no