No, root is not locked

The root account on your Ubuntu machine is not locked. Neither is the account disabled. I don’t know why the wiki says the account is locked because it isn’t.

Maybe it’s just me, but “locked” implies that the account has been frozen. If I mistype my password three times at work, I’m “locked out.” No matter what password I type at that point, I can’t log on because the servers won’t let me. The account is valid and active, but because I made a mistake (three times in a row 🙄 ) it is locked.

Furthermore, “disabled” is wrong too. My co-worker quit two months ago, and if I try to log on as him, I get a message that the account has been disabled. Our security system recognized the user ID and maybe I got the password right, but it won’t allow me to log on because it’s no longer a valid account. It’s disabled.

That’s not what’s happening in Ubuntu.

The problem is that the root password is scrambled. Nobody knows what the password is except Ubuntu (and maybe Mark Shuttleworth 😛 ), and Ubuntu’s not talking.

You could sit there and peck away for hours on end like the proverbial monkey at the typewriter, and maybe with luck you’d get the right one. (Of course, after a certain number of attempts, Ubuntu might lock the account, or even disable it. 😀 )

But that doesn’t mean you can’t log in. In fact, I can log into my root account — I just have to change the password. (Or boot into recovery mode.) There’s a big difference between that and locked, or disabled. At least from my perspective.

Perhaps the wiki needs attention. Again.

4 thoughts on “No, root is not locked

  1. Johnny Chadda

    Well, it is in fact disabled/locked.

    Do a sudo cat /etc/shadow|grep root and you will see that there is a star where the hashed password should be, implying that the account is in fact disabled.

    “If the password field contains some string that is not valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in, subject to pam(7).”

    Reply
  2. Pete

    you don’t even need to set the root password to login as root.
    sudo su –
    from a command prompt will log you in as root.
    and the beauty of sudo lets you run the command with your password.
    (the – is optional but i find it useful since it starts a new session and doesn’t keep your ENV vars but if you need to keep them its a good idea to omit the -)

    just a little thing i worked out when i was using OS X when i discovered the root user was disabled as well.

    Reply
  3. Luke

    So, did you correct it? I mean, that’s the point of having a wiki, right? To allow community to generate all this information and fix the errors as they appear on the pages.

    Johny, my /etc/shadow has a hash for root. Not sure why but it does. I faintly remember mucking around with the root account long time ago, so maybe that is the reason.

    I pretty much do what Pete suggested – I have a button on my taskbar that opens up a “root” terminal for me when I need it. 🙂

    Reply
  4. K.Mandla Post author

    Hey, thanks for all the tips. I had a feeling the distinction was my interpretation of the word “locked.” My understanding of the root account goes back a year ago, and it’s possible that the randomized root password was something I picked up then.

    All the same, I don’t think I would explain to a new Linux user that the account is “locked,” because it suggests it’s completely inaccessible. From my viewpoint that’s incorrect, since again, changing the password is all that’s required to use it.

    Thanks again, everybody.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s