This commit is contained in:
2026-05-11 09:15:08 +02:00
parent 9bec2b9e42
commit 404ee3fec4
641 changed files with 416825 additions and 0 deletions
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
parameter_sshd_t=permituserenvironment
parameter_sshd_config=PermitUserEnvironment
desired_value=no
if ! command -v sshd &>/dev/null; then
echo "sshd command could not be found"
exit 0
fi
# Check using sshd -T output
actual_value=$(sshd -T | grep -i "$parameter_sshd_t" | awk '{print $2}')
if [ -z "$actual_value" ]; then
if grep -iq "^$parameter_sshd_config" /etc/ssh/sshd_config; then
actual_value=$(grep "^$parameter_sshd_config" /etc/ssh/sshd_config | awk '{print $2}')
else
exit 1
fi
fi
if [ "$actual_value" = "$desired_value" ]; then
exit 0
else
exit 1
fi