+3 votes
in Operating Systems by (40.5k 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

+1 vote
by (346k points)
selected by
 
Best answer

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'.
From
#PermitRootLogin prohibit-password

to

PermitRootLogin yes

  • Restart sshd service.

systemctl restart sshd.service

Related questions

+2 votes
1 answer
+2 votes
1 answer
+4 votes
1 answer
+4 votes
1 answer
asked Nov 16, 2021 in Operating Systems by kush (40.5k points)
+3 votes
1 answer

...