Enabling Root Account in Ubuntu

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
12,331
Reaction score
11,154
Credits
101,546
So, I wrote a simple article but made it into something more than that, covering one of my pet peeves.

Enable Root in Ubuntu

I used it as an excuse to rant about how certain forums treat people that ask questions. It doesn't really apply to this site - which is one of the reasons I hang out here. I've seen n00bs eviscerated for asking how to enable root - and the question remaining unanswered.

As always, feedback is appreciated.
 


Nice rant, totally agree. ;)
 
Nice rant, totally agree. ;)

It's one of the reasons I hang out here as much as I do. This site isn't really like that. If someone wants to enable root, we darned well tell 'em how to enable root (and give the appropriate warnings). We're not aloof, elitists, or inconsiderate.

It's a pretty comfortable place to be.
 
It's a pretty comfortable place to be.
Amen to That! It is also the reason I hang my hat here.

Good people, good knowledge, and a scarcity of pita
 
a scarcity of pita

And drama. This forum has very little drama as compared to many.

Though I suspect that was included in your 'pita'!

There's also not a lot of 'dog-piling.' Someone can tell a person, "Hey, ask better questions and give us more info!" and not a lot of people will follow up with it and run the user off. You might get a brief burst of displeased people, but the questions get answers and it's not over the top.
 
So maybe I'm one of "those guys".

When a new user, comes sliding into the forum on four wheel drive with pedal to the metal screaming about how hard Linux is on the poor user who just wants to have "access" to his/her data. I'm not going to give a straight to root answer. Because that user will come sliding in again on four wheel drive with the pedal to the metal screaming about how Linux screwed his/her data.

No, I will simply tell the user about the benefits and ease of using sudo and how it protects the user's system while still giving elevated permissions. If the user says Thanks and goes off to do the sudo thing, and realizes that what was told was factual, then comes back with a reasonable conversation about security, then Yes, I would tell the "secrets" about elevated root permissions.

Otherwise, no. And that's just the way I roll.
 
So, I wrote a simple article but made it into something more than that, covering one of my pet peeves.

Enable Root in Ubuntu

I used it as an excuse to rant about how certain forums treat people that ask questions. It doesn't really apply to this site - which is one of the reasons I hang out here. I've seen n00bs eviscerated for asking how to enable root - and the question remaining unanswered.

As always, feedback is appreciated.
Hey David... just a heads-up that simply creating a root password in Ubuntu was not enough to allow a root login on the computer. It might work for ssh, or something else, but not to log in as root user. Just tried it with Ubuntu 20.04.2 while testing for another thread and it didn't work in a VM. I think that method does work on other distros, so not sure what's up with Ubuntu. Or maybe I'm missing something?
 
Hey David... just a heads-up that simply creating a root password in Ubuntu was not enough to allow a root login on the computer. It might work for ssh, or something else, but not to log in as root user. Just tried it with Ubuntu 20.04.2 while testing for another thread and it didn't work in a VM. I think that method does work on other distros, so not sure what's up with Ubuntu. Or maybe I'm missing something?

Ubuntu won't let you use it to login through the GUI with root (without more tweaking) but you can use it for TTY and whatnot. Like 'su root' and then type in the password you generated. That's why I only made those claims on the site.
 
Also, @stan you've given me an idea for another article. I'm gonna tell people how to enable root login from the GUI!

(It's not too hard, as memory serves. You next edit GDM and PAM.)

And, I've been thinking of better verbiage for the existing article. I say 'for TTY and whatnot'. That's not very clear, so I can see why it'd create confusion. It made perfectly good sense to me - and I wasn't even drinking wine at the time of writing.

Anyone have any good ideas to make it more clear?
 
(It's not too hard, as memory serves. You next edit GDM and PAM.)
Exactly right. It was easy done.


Anyone have any good ideas to make it more clear?
Console login? Terminal login? I'm not sure new users would be familiar with "TTY," but Terminal is fairly well known.
 
Console login? Terminal login? I'm not sure new users would be familiar with "TTY," but Terminal is fairly well known.

I'm going to have to think about it. I'm leaning towards something like:

... TTY and whatnot (but not at the GUI login when starting your system, see a future article for that)

Something like that, maybe?

It made perfect sense to me when I wrote it, but I know what TTY is and the other limitations. So, making sense to me isn't really a very good bar with which to judge.

This is exactly why I ask for feedback, thanks!
 
It is really long-winded and awkward reading, but I think this makes it more clear. The edit is:

That's it. Root is now enabled and you could login as root via TTY (this does not allow you to login as root via the GUI login during boot, that's for a different article) or whatnot. You just probably shouldn't. See, root has access to everything. It's a security risk and it's increasing the likelihood that you'll irrevocably ruin your operating system when you fat-finger a command. Seriously, don't do this. It's just a bad idea and you can easily use 'sudo'.
 
The way I see it - It's your system you have the freedom to do what you want - if you want root enabled then enable it - if you do not then don't - you can discuss the pros and cons all day - the bottom line is it's your system do whatever you are comfortable with.
 
the bottom line is it's your system do whatever you are comfortable with.

Darned right. When someone asks how to do something like that, I answer the question. I give them the appropriate warnings, but I tell them how to do it.
 
Just want to say a dumb thing i did recently out loud. I used a command you should never do but
sudo rm / -rf *python*
And then terminal would not even open and i had to use a usb to reboot.

Please dont ask why i did that
 
Last edited:
@ex4722 ..but you've got us intrigued now
Alright lets hear a dumb story.
So i started learning python a while ago cause i wanted to automate something. BUT i may have installed python2 instead of 3 and then i messed up with pip pip3 and python -m pip. This led to me having a great idea to just run the best command with sudo and -rf and remove everything with python in it. Needless to say the first thing that happened was dpkg stopped working and it was really bloody in my terminal screen. Then i tried to open a new terminal and nothing happened. Then I freaked out but remembered that i still had my live usb sitting around so i just rebooted from that and now everything works. So lesson learned kids never ever use sudo with rm and -rf for anything.
 
Yeah, we see people who removed Python on the SE sites. The best solution for that is usually just to backup any important data and reinstall, having learned a lesson in the process.
 


Top