Commit a6b093b3f5
Unsigned
Layout: unified · split
os/linux/ssh_root_login.sh +13 −1
| @@ -1,3 +1,15 @@ | ||
| 1 | 1 | #!/bin/bash |
| 2 | 2 | |
| 3 | grep -E "PermitRootLogin" /etc/ssh/sshd_config | |
| 3 | # Find the PermitRootLogin setting in the sshd_config file | |
| 4 | permit_root_login=$(grep -E "^[[:space:]]*PermitRootLogin" /etc/ssh/sshd_config) | |
| 5 | ||
| 6 | # Echo the setting for the user | |
| 7 | echo "Current PermitRootLogin setting:" | |
| 8 | echo "$permit_root_login" | |
| 9 | ||
| 10 | # Check if PermitRootLogin is set to something other than 'no' | |
| 11 | if ! echo "$permit_root_login" | grep -q "no"; then | |
| 12 | echo "" | |
| 13 | echo "PermitRootLogin is not set to 'no'. Checking for AuthorizedKeysFile location..." | |
| 14 | grep -E "^[[:space:]]*AuthorizedKeysFile" /etc/ssh/sshd_config | |
| 15 | fi | |