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

Category: VPS Management

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

Disable root login via SSH — a critical security hardening step

Once you have a sudo user configured, disable root SSH access. This prevents attackers from targeting the root account directly. Run 'sudo systemctl restart sshd' after.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.