+2 votes
in Operating Systems by (1.0k points)
I am facing a weird issue on my VPS that has Debian 10 OS. While installing Debian 10, I was prompted to create a non-root user. Now I am able to SSH to my VPS using non-root user whereas when I try to use root, it gives timeout error.

How can I fix this problem?

1 Answer

0 votes
by (23.4k points)

You need to check the variable 'PermitRootLogin' in the sshd_config file. If its value is 'no'/'prohibit-password' or it's commented out, you will not be able to SSH as root.

You should follow these steps to enable SSH as root:

  • Open the file sshd_config.
# vi /etc/ssh/sshd_config
  •  Find the variable "PermitRootLogin", uncomment it and set it to 'yes'.
#PermitRootLogin prohibit-password


PermitRootLogin yes

  • Restart sshd service.

systemctl restart sshd.service