How to enable the root account in Ubuntu


Recommended Posts

Ubuntu is one of the few Linux distributions out there that will not enable the root account.In case you want to enable root login on your Ubuntu system this post will show you how you can do that.

As you have noticed during the Ubuntu installation there was no question about the root password,as you might have been used to see during other Linux distributioninstallation process. This is why the root account is inactive andcan?t be used (no password configured) until we will setup a properpassword for it. To do this, we simply need to run:

sudo passwd root

This will ask for a new root password and once you confirm it, you can start using the root account to login.

In case you will want tdisable back the root accounb>t, just lock the root account by running:

sudo passwd -l root

Are you aware of any other Linux distribution that doesn?t enablethe root account at installation time? I am just curious because Ibelieve that this is a great idea? but I haven?t seen it implemented inother distributions.

  • 2 weeks later...
  drygnfyre said:
Thanks, this was a useful how-to. Although I've found that with Ubuntu, you really don't need to create a root user, since you can just use sudo.

Distro's don't run as root as standard because its pointless and dangerous. A big plus in Linux is the security, if you run as root you throw that security down the drain :)

  • 2 months later...
  Phixion said:
Distro's don't run as root as standard because its pointless and dangerous. A big plus in Linux is the security, if you run as root you throw that security down the drain :)

I'd have to agree with you. This is one of the biggest criticisms of Linspire and its derivatives, the fact that by default, you're running as a root user. The way I see it, anything that you could possibly need to accomplish with a root account can be and/or should be done with sudo.

personally, I prefer to do the above, then keep logging as as my user and when I need root access, I just su it, then I don't have to annoyingly type sudo everytime I need to write a line in. Just makes it a bit handier for me without killing my security

  • 2 weeks later...

you guys know you can just sudo su *password* and it will give you a constant root prompt right? that way you don't have to sudo over and over if you have a bunch of commands.

sudo su *password* gives you a root terminal, do your work, close out, no need for a root login.

  • 10 months later...
  • 6 months later...

I ran into the similar issue where it would not let me edit the Menu.1st file Said I was not the owner- Tried opening with Sudo but to no avail-

I added a user then changed them to member of root- then logged off. Then signed in as the newly created user then I opened a command prompt- typed whoami and it said I was then root. Changed the Menu.1st file.

Because at the Sign in screen for some strange reason Ubuntu will not let Root have a desktop- but will allow a User in the root privilages can.

I hope this helps. BEFORE ANYONE SAYS IT I KNOW_ Resurecting an Old thread but I found another way to do this where still allowing you to maintain the User status but allowing you not to have to Type Sudo before everything.

The reason I had to do this... Is because even with the Sudo Su "Password" open editor- To change the Menu.1st it said I was not the owner and would not allow me to save.

But by creating the New User "Admin" then making him a member of Root. I was able to sign in with a full desktop and use the Text Editor to change and save the file.

Edited by redvamp128
  devilotX said:
you guys know you can just sudo su *password* and it will give you a constant root prompt right? that way you don't have to sudo over and over if you have a bunch of commands.

sudo su *password* gives you a root terminal, do your work, close out, no need for a root login.

That's a good tip that I had not thought about. Using sudo to call up su, brilliant!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I will confirm the Vista hate was ridiculous. They had a point before SP1 and too many didn't use newer components at launch, misleading some to believe it was bad. It really wasn't (after SP1.) The jump from 98/ME to XP didn't get a bad reaction at all from what I remember. 8 was awful. 10 for the most part ran pretty well but people disliked the telemetry and standard MS shenanigans, but 11 is definitely worse in some ways.
    • What I can confirm to not be exaggerations or misinformation is the slowness of the standard right click menus and the Task Manager in Windows 11, even on brand spanking new bare installs.
    • Linux 6.16-rc2: Smaller than usual, but with notable network and bcachefs tweaks by Paul Hill Linus Torvalds, the creator of the Linux kernel, has just released the second release candidate of Linux 6.16. Following the release of Linux 6.15, developers submitted their new features to be merged with Linux 6.16. These release candidates are focused on polishing the kernel before release, following the merging of new features. In his weekly mailing list post, Torvalds noticed that things were pretty quiet this week and that this could be due to developers taking a summer vacation or just taking a break following a large merge window a few weeks ago. This isn’t uncommon at this point in the cycle and Torvalds expects more activity next week. Networking and bcachefs dominate changes The second release candidate, despite being small, still brings some notable changes, namely network drivers, Bluetooth drivers, and bcachefs, a copy-on-write filesystem for Linux. The improvements to network drivers have a direct impact on end users, it means that newer networking hardware works out of the box when you install Linux and existing problematic drivers get fixed. There were also improvements made to the Rust infrastructure and core networking changes. Implementing Rust in the kernel is good for users as it has memory safety built in, leaving hackers less to attack in Linux systems. Rust has received backlash by some opinionated Linux developers who don’t want to learn a new language, but it doesn’t look like it’s going anywhere. Under the hood: specific fixes This week, a diverse set of developers have contributed fixes to the kernel that improve kernel stability, Bluetooth connectivity, file sharing over SMB, and virtualization performance. Some specific changes this week include: Fixes for CPU burning, firmware stats, and use-after-free (UAF) issues with the ath11k and ath12k Wi-Fi drivers. Various fixes for UAF, NULL pointer differences and advertising issues in Bluetooth drivers. Improvements to Server Message Block (SMB) related to directory cache reuse and a fix for performance regression with deferred closes. In KVM (Kernel-based Virtual Machine), there are fixes for SEV-SNP support, memory pre-faulting, and ARM64 selftests. The SMB fixes are notable because it's an important protocol in networked Windows environments. It helps with file sharing, printer sharing, and Active Directory integration. By improving Linux’s support for this protocol, readers using SMB in Linux to talk to Windows machines will have a smoother experience. Ongoing development Linux 6.16 is due to get seven or eight release candidates over the cycle so there are now five or six weeks until the stable version arrives. Even when it is out, most people’s first use of this kernel will be when distributions decide to ship it, as they can be tricky to install manually. Stay tuned each week as we bring you all the new changes which each new release candidate.
    • Just checked my B650 Motherboard again, nothing there as yet, Guess 800 series getting it first, which i can understand as that's newer series, and chipset. I'll check again in a few days or a week depending on how busy i am
  • Recent Achievements

    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
    • First Post
      CSpera earned a badge
      First Post
    • One Month Later
      MIR JOHNNY BLAZE earned a badge
      One Month Later
    • Apprentice
      Wireless wookie went up a rank
      Apprentice
  • Popular Contributors

    1. 1
      +primortal
      624
    2. 2
      ATLien_0
      275
    3. 3
      +FloatingFatMan
      178
    4. 4
      Michael Scrip
      152
    5. 5
      Steven P.
      115
  • Tell a friend

    Love Neowin? Tell a friend!