Enable root user in Ubuntu

Those of us who administer systems love to use the root user, because installing sudo on a server is not something I like to do, because it gives foot (opportunity) to have more users with administrative privileges on the server 😉

The problem is that when we get home and we are using a distro like Ubuntu, the root user is not enabled ... you know, Canonical in their effort not to damage the system simply does not let us use root directly ... ¬_¬ ... I don't know you guys, but this looks a bit like Windows to me hehe.

How to enable root in Ubuntu

Those who wish to have root enabled is simple, with 2 commands we can do it.

sudo -i

This will allow us to access as root, of course, after we put the password of our user.

sudo passwd root

This will change the password of the root user, and voila… we can press Ctrl + F1 and put as root user and as password the one we just specified.

Related article:
Permissions and rights in Linux

How to disable root in Ubuntu

With one command it will be enough to disable it again:

sudo passwd -dl root

The end!

Well, nothing more to add, this is a really short post, I hope it will be useful to someone.

Enjoy!

Btrfs
Related article:
How to mount HDDs or partitions via terminal

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Marco said

    You can do it with a single command:

    sudo -u root passwd

    😀

    1.    Norach said

      I am starting in the world of Linux, I installed Ububtu 14.10 with the user luis and I cannot manage using the root user from the user luis, Ubuntu notifies me that it does not have permissions because it does not appear in the sudoers file. What can you do?
      Thank you…

  2.   toñolocotelan_te said

    What a good tip, thanks.
    I do not understand why they throw so much at Ubuntu since Linux is the one that best goes along with Fedora; that is, who is looking to the future in the world of distros, who is working on portable systems, who is developing in the direction of to cell phones, to touch systems, who is opening the possibilities that Linux also offers in the field of non-specialized users, so-called desktop users, etc? ... Well, Ubuntu. And to break through to the desktop, it is necessary to open up way in the business and the rules of the business are already written and without they have to survive they MUST adapt to the market.
    Perhaps eccentricities like Gentoo will not disappear, to say the least, and definitely the servers should remain in specialized hands, but the common user does not give a peanut if Ubuntu looks like Windows or not, which matters to him, and it is good that it is so is that when you connect a usb or when configuring your wifi connection, etc, it works for you, period. And this is offered by Ubuntu. No arch, no debian, not the ones they want, but Ubuntu, Fedora and OpenSuse, those that have corporations behind, that is, those who are in business, the same Windows business.

    1.    elav said

      At what point has Ubuntu been "dumped"? : /

    2.    Javier said

      ... connect a usb, configure your wifi connection, it works for you and period ...

      Well that is the problem, everyone thinks without any basis in what they say.

      For example, have you ever used Debian?

      Because everything you say works perfect for me after the default installation without having to do anything.

      Regards,
      Javier

      1.    Vicente Ballester said

        Without detracting from Debian it is not the same as Ubuntu, the installation is now more friendly but for advanced users and not for novices and if you have to install soft many times they are very difficult to configure them for a simple installation and in that Ubunto has an advantage I think both Debian and Gentos are very good distros, only that I have to have some knowledge, I use Debian Mandriva, Fredora and I can assure you that Ubunto or Mandriva are very easy for newbies.

    3.    yo said

      You are right man. If Linux is to survive the desktop and still have a place in the world that comes from mobiles, pads, etc., it has to follow paths like the ones Ubuntu follows. I agree 100% with you… ..BUT I think you made the wrong post because in this one the author doesn't throw anything at Ubuntu (not even good vibes, because we all know that KZKG ^ Gaara is archero at heart…. I think) 🙂

  3.   Yoyo said

    Good info and good contribution from @Marco

    Is appreciated.

  4.   Fosco_ said

    Although the information is correct, it does not seem appropriate to activate the root user in distributions like Ubuntu and derivatives that have been designed so that root never has direct access to the system. Most security flaws and accidental disasters are caused by improper use of the root user, so the further away root is from the system the better.

    Instead it is more advisable to use "sudo" for administrative commands or "sudo -i" if we need a continuous administrative session.

    1.    elav said

      You're right, this has to be used with care, but it doesn't mean that we can also teach people how to do it. If they make a good or bad decision, it is up to everyone. 😉

  5.   aitkiar said

    I had always used something simpler:
    sudo sh
    Passwd

  6.   jvk85321 said

    I only use

    sudo passwd

    And with that the root password is defined in ubuntu and debian

    atte
    jvk85321

    1.    Jorge said

      The "sudo passwd", together with the "sudo su", are a classic of classics. It couldn't be faster and easier 😀

  7.   cristian said

    and now the
    [code] sudo su [/ code]

  8.   Mario Guillermo Zavala Silva said

    I loved the publication including your comments regarding Win ...
    GREETINGS!

  9.   Chaparral said

    I always use sudo -s when I want to login as root.
    I know that you should not access as root, but there are times when there is no other remedy.

    It would not hurt a tutorial in this regard to clarify positions.

  10.   Ermac said

    Thanks, it worked

  11.   suan said

    Thank you, I wish all the explanations were so short xd.

  12.   edgar said

    I want to open a program and it asks me to be root user
    What do I have to do

  13.   Raiki said

    How do you start a new root interpreter?

  14.   Andres Eduardo Garcia Marquez said

    please add how to authorize it in open ssh

  15.   miller said

    great compa

  16.   Robert said

    thanks for the contribution, it helped me a lot

  17.   oliver said

    simple ... if you know. Thank you

  18.   machuca said

    when he tells me to put the password he won't let me write, what do I do ????