Allow your root user to use SFTP with one simple change

In most of modern Sever providers such as DigitalOcean, Hetzner root users are not able to login to the server using SFTP.

Yes, adding MATCH USER vlock can solve the problem, but for an auth with password, not with public key.

To enable our root user to login to our server with public key, we just need to add this single line to our ssd_config.


nano /etc/ssh/sshd_config



and then save it using CTRL+O

Then do a SSH restart.

sudo systemctl restart ssh

It should look like this

That’s all, now you should be able to login to your server just by typing


Get more useful WP tricks and snippets by subscribing to my mailclub.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.