Sometimes you only get non-root user permissions when renting a cloud or dedicated server from certain providers. It might make it difficult for you when you need to install new packages or software. Or even you need to get root access by calling the “sudo su” command multiple times. Yes, but it can make your fingers very tired, and inefficient.
Well, in today’s guide, I will teach you on how to enable root login on Debian/Ubuntu based server. This is a very basic tutorial and I don’t think you will have any difficulties with it. You only need to pay attention step by step.
1.) Run “sudo su” Command via SSH Console or PuTTY
Since you don’t have full-root access to your server, so we need to run “sudo su” command for the first time. Then, type password for debian user.
$ sudo su $ [sudo] password for debian:
I often find that some dedicated server providers don’t allow full root privileges after the server has been installed with a fresh Debian / Ubuntu based distribution. Generally we will access servers with basic users like debian, ubuntu, etc.
2.) Edit sshd_config File
After you have successfully logged in to your server as root user, we have to change some values in the sshd_config file.
$ nano /etc/ssh/sshd_config
Be sure to uncomment on the following variables.
#PermitRootLogin yes #PasswordAuthentication yes #StrictModes yes #AllowUsers root
3.) Restart SSH Service
$ systemctl restart ssh.service $ service ssh restart
Now you have full root privileges on your server, and try to access it with the root user.