How to Enable Root Login via SSH on Debian 10 (Safely)
Last week I was setting up a new Debian 10 VPS for testing some firewall rules. I needed to enable root login via SSH, not ideal, I know but sometimes it just saves you time.
Debian blocks root SSH logins by default, which makes sense from a security standpoint. Still, if you’re working in a secure lab or setting up a temporary system, allowing root login can be really convenient.
Let me show you exactly how I got it working, safely.
What You’ll Need First
No need to overcomplicate things. Just make sure you have the basics:
A Linux Debian 10 server from neuronvm (physical or a NeuronVM Linux VPS, both work)
One user account with sudo access
SSH installed and up and running
That’s all you need to follow along.
🚫 Why Root Login Is Blocked (And It Should Be)
If you’ve tried logging in as root and got a “Permission denied” message, don’t panic. That’s just Debian doing its job.
Like many Linux distros, Debian blocks root SSH login by default to protect your server from brute-force attacks. It’s a smart default, especially if you’ve just brought your server online.
That said, if you’re in a safe environment (e.g. private lab, or temporary setup), enabling root login for a short while can actually help you move faster, as long as you lock it down.
✅ Step-by-Step Guide to Enable Root SSH Access on Debian 10 | 11
Let’s walk through the steps I used to get root login working.
1. Open the SSH configuration file
Edit the SSH configuration file using any text editor you prefer, here, I’ll go with nano.
sudo nano /etc/ssh/sshd_config
2. Find and update PermitRootLogin
Look for the line that says:
#PermitRootLogin prohibit-password
Uncomment the line and change its value to “Yes“. If the line is there but has a # at the beginning, that means it’s inactive, remove the # to activate it.
PermitRootLogin yes
🔐 Tip: If you’re using SSH keys, you can instead set it to PermitRootLogin without-password for better security.
You can learn more about PermitRootLogin and other SSH options in the official OpenSSH sshd_config manual.
3. Save and exit the file
In nano editor, press CTRL + O to save, then CTRL + X to exit.
4. Now, you can save the updated /etc/ssh/sshd_config file and restart the SSH server. Use the command below to do this:
sudo systemctl restart sshd
And that’s it. If no errors pop up, you should now be able to connect as root via SSH your Debian server using the root user account.
🔐 Be Careful with Root Access
I’ll say it straight: enabling root login isn’t something I recommend casually. It opens a door, and unless you know exactly who’s on the other side, that can go badly. Personally, when I do it, I always:
Stick to SSH keys (no passwords, ever)
I always restrict SSH access to my own IP address using UFW. It’s a small step, but it makes a big difference security-wise.
And as soon as I’m done, I disable it again
If you’re planning to leave it enabled long-term… don’t. Really. Look into tools like Fail2Ban to catch failed login attempts, and always monitor your logs.
Final Thoughts (Real Talk)
Enabling root login over SSH on Debian 10 isn’t hard. But it does require responsibility. For daily work, you’re better off using a normal user with sudo.
Still, now that you know how it works, at least you’re making an informed decision, not just flipping a switch blindly.