Docs / Security / How to Disable Root SSH Login

How to Disable Root SSH Login

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 418 views · 1 min read

Disabling root SSH login is one of the most effective security hardening steps.

Prerequisites

Before disabling root login, make sure you have:

  1. A non-root user with sudo access
  2. SSH key authentication configured for that user

Disable Root Login

Edit /etc/ssh/sshd_config:

PermitRootLogin no

Restart SSH:

systemctl restart sshd

Test Before Disconnecting

Open a new terminal window and test logging in as your non-root user before closing your current session. If it works, you're safe to close the root session.

Emergency Access

If you lock yourself out, use the VNC Console in your Kazepute portal to regain access.

Was this article helpful?