Chat Zalo Chat Messenger Phone Number Đăng nhập
Enable Root Login Via SSH In Debian 10 - Blog - ElderNode

Enable Root Login Via SSH In Debian 10 – Blog – ElderNode

Enable Root Login via SSH In Debian 10

Secure Shel allows you to manage your network service to control any unsafe situation. In Linux and Unix as operating systems, the root user acts as a superuser who can do many things that an ordinary user cannot. To connect to your system remotely and perform administrative tasks, you must log in as root. In this article, you will learn how to enable root login via SSH in Debian 10. If you are preparing to buy your own Linux VPS, visit the available packages from Eldernode to buy the best one.

To enable this tutorial to work better, consider the following prerequisites:

A non-root user with sudo privileges

.

To configure, follow our initial setup with Debian

10.

Tutorial Enabling root login via SSH in Debian 10 | Debian 9 Debian

Linux does not allow logging into the server as root via SSH protocol and has been disabled from the main ssh configuration file by default. Therefore, you receive an error message (due to security reasons) while trying to log in as root. The error message is “Permission denied, please try again.” Join us with this article to review the process of enabling root login via ssh.

Log in as

root

When you log in with the root account, you are a special user with administrative rights. However, you need to be sure of your knowledge about the commands you execute, as any sloppy or malformed command will render the entire operating system unusable. That’s why security reasons don’t allow you to log in as root and you have to enable it. In Debian, it is originally enabled as a security precaution, which means that you cannot log in directly as root via SSH.

Allow SSH root login in Debian

Because the PermitRootLogin parameter controls the ssh root permission, you must change its values. The parameter is /etc/ssh/sshd_config and the value of PermitRootLogin is “without-password”. Therefore, it must be PermitRootLogin to Yes to allow root login.

How to enable root login via SSH

Below, you can review the necessary simple steps from this guide. In this way, you can change the default disabled mode to enable and log in via SSH.

Open the ssh configuration file and use your favorite text editor.

nano /etc/ssh/sshd_config

Then, find PermitRootLogin and change its value to “Yes”. If the line exists and is commented with a “#”, delete the “#”.

PermitRootLogin yes

Now, you can save the updated /etc/ssh/sshd_config file and restart the SSH server. Use the following command to do this:

systemctl reboot sshd

i.e. if you don’t see any new errors, you should be able to access your Debian server using the root user account via SSH protocol

.

Conclusion

In this article, you learned how to enable root login via SSH in Debian 10. As you know, by default SSH root login is disabled in Debian as it does not recommend using root password via ssh. So, you can ssh to the server like a normal Linux user and then use the su command to log in as root. In case you are interested in reading more, find our related articles on Installing SSH Server on Linux and Allowing Root User Login.

Contact US