In this article, I’m going to show you how to enable the root account with Ubuntu. This is a terrible idea and you should definitely not do this. Ever.
A while back, I told you how to enable root in Ubuntu. In that article, I also wrote about the people who don’t answer questions when they don’t think you’re doing things the right way. Being the kind of person I am, I’ll happily tell you how to make your OS less secure.
And, trust me, this is a horrible idea from a security perspective – especially if you don’t have good physical security. Then again, if you don’t have good physical security then your computer is already compromised if someone wants to just boot to a live USB thumb-drive and if you haven’t taken the steps to encrypt your private data.
NOTE: This is only good for Ubuntu. It looks like it should work from 18.04 to 20.10, and will probably continue to work until Ubuntu moves on from GDM3. (GDM3 is Gnome Display Manager 3, a drop-in replacement for GDM.) This may work for other Ubuntu flavors, I haven’t tested. If you do test or know, please leave a comment below. Thanks!
Anyhow, on with the work. This shouldn’t take too long.
The first step is to set up the system so that you can login as root. To do that, you have to enable root login for Ubuntu. You should probably read the warnings on that page and you should think carefully before doing this to your own computer.
The next step is to crack open your default terminal emulator. You can do that by pressing CTRL + ALT + T.
Now let’s make you a superuser. You can do that with:
(Press enter and enter your password, of course.)
Our next step is to tell GDM3 to let us use the root login.
You’re going to arrow down to just below the automatic login configurations and enter this line:
Then, you’ll press CTRL + X, then Y, and then ENTER. (Congratulations, you’ve used ‘nano’ again and edited a file in the terminal!)
Our next step is to tell PAM (Pluggable Authentication Modules) that logging in as root is okay. That’s pretty easy, and we’ll do it with nano once again.
Now, scroll down and look for this line:
What you’re going to do is ‘comment it out’. Basically, you’re adding the # symbol which means, in this case, ‘skip this line’. It’s a way to tell the system to ignore a line while leaving the line there in case you change your mind.
So, change that line so that it looks like this:
Now, save it just like you did above. (Press CTRL + X, then Y, and then ENTER.)
You’re still using ‘sudo su’ and you can get out of that mode with:
Now, when you next reboot, you can login as root. What you need to do is click on ‘Not Listed’, type in ‘root’, and then enter your password.
Tada! You’re now logged in as root for no good reason and with almost no benefits! Congratulations! Now, undo it and go back to being a bit more secure. Or not… I don’t mind. Just don’t let your box get owned and turned into something malicious like a spam bot or a node in bot network used to do things like DDOS sites for money. Seriously, this is a horrible idea and you shouldn’t do this.
Anyhow, thanks for reading. I appreciate it and I’m glad to get some of my notes online – finally. Things seem to be going at a good pace right now and I suspect I can keep this up for a while. If you want to be notified of new articles, you can either sign up for the newsletter (which is spam free) or you can use push notifications and your browser will happily tell you when there’s something new published. If you sign up for the newsletter, I promise to not send any spam. I’ll only ever use it for article notifications or very important site notices.