audit-labs/audit-tools
A collection of scripts, queries, and other goodies you can use in an audit.
clone: git clone https://gitbay.org/audit-labs/audit-tools.git
cebaf4e251d2f13df51b7f6dab027e30bbac414f
signed_unknown_key
author: Christian Cleberg <hello@cleberg.net> · 2025-12-12T16:51:55Z
committer: <noreply@github.com>
os/linux/ssh_root_login.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) @@ -1,3 +1,15 @@ #!/bin/bash -grep -E "PermitRootLogin" /etc/ssh/sshd_config +# Find the PermitRootLogin setting in the sshd_config file +permit_root_login=$(grep -E "^[[:space:]]*PermitRootLogin" /etc/ssh/sshd_config) + +# Echo the setting for the user +echo "Current PermitRootLogin setting:" +echo "$permit_root_login" + +# Check if PermitRootLogin is set to something other than 'no' +if ! echo "$permit_root_login" | grep -q "no"; then + echo "" + echo "PermitRootLogin is not set to 'no'. Checking for AuthorizedKeysFile location..." + grep -E "^[[:space:]]*AuthorizedKeysFile" /etc/ssh/sshd_config +fi