IS_SSHPERMITROOTNO: do not display sshd errors

This commit is contained in:
Jérémy Lecour 2022-07-28 14:17:02 +02:00 committed by Jérémy Lecour
parent 0c16fcf311
commit 72a85bc9ef
2 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Changed ### Changed
* IS_SSHPERMITROOTNO: do not display sshd errors
### Deprecated ### Deprecated
### Removed ### Removed

View file

@ -1236,7 +1236,7 @@ check_sshpermitrootno() {
sshd_args= sshd_args=
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if ! (sshd -T ${sshd_args} | grep -q 'permitrootlogin no'); then if ! (sshd -T ${sshd_args} 2> /dev/null | grep -qi 'permitrootlogin no'); then
failed "IS_SSHPERMITROOTNO" "PermitRoot should be set to no" failed "IS_SSHPERMITROOTNO" "PermitRoot should be set to no"
fi fi
} }