Cheat Sheets

SSH - PermitRootLogin no

Description

Checks /etc/ssh/sshd_config for PermitRootLogin no

Solution

sed -i 's/PermitRootLogin.*yes/PermitRootLogin no/' /etc/ssh/sshd_config

Check Script: ssh-no-root.sh

#!/bin/bash

if grep -q "PermitRootLogin no" /etc/ssh/sshd_config 2>/dev/null; then result_ok else result_failed fi
Comment on Disqus