Enabling And Disabling Root Account in Debian/Ubuntu

Sathya | May 27th, 2008 - 10:00 am


Debian and other debian-based distros like Ubuntu have, by default, has the root account disabled as a security measure.(thanks to Subbu and PICCORO for the clarification)

To re-enable the root account, just open the command prompt, and type

sudo passwd root

You’ll get the following set of messages:

sathya@sathya-laptop:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
sathya@sathya-laptop:~$

To disable root access, just type

sudo passwd -l root

If you’re weary of using the command line(you shoudn’t ;) ) then there’s another way:
Just head over to System > Administration > Login Window > Security > and check mark the box beside Allow local system administrator login.

DISCLAIMER: Christof Baumann mentions in this post as to why you shouldn’t fiddle with the root account:

Be aware of locking the root account if you once activated it. I activated the root account and skipped the %admin ALL=(ALL) ALL line int /etc/sudoers file because i thought i wouldn’t need it anymore. Then i disabled the root account without thinking and now had no chance to start programs with root rights. Luckily i could restore it using a knoppix live cd. Be aware of changing settings concerning the root account.

Also, read this article in Ubuntu Wiki as to why sudo is preferred over standard root account.

PS: Just incase you guys are wondering why I’ve posted this basic info so late, well I’m just getting the hang of Ubuntu.

If you enjoyed this post, make sure you subscribe to my RSS feed!

7 Responses to “Enabling And Disabling Root Account in Debian/Ubuntu”

  1. Subbu says:

    Dude.. Give Ubuntu a skip and try Debian.. (i.e. If you don’t mind Over-User-Friendliness and ‘teh cool effectz! *squeal!!1!!11\!’*)

    Reason being it’s much more stable.

    And Um.. FYI, Debian HAS Root Account.. You can disable it by installing sudo. (Nope.. Not Installed by default)

  2. Sathya says:

    Subbu: Ubuntu was on my VM. Was just exploring it. Not the greatest fan of Ubuntu. I’m waiting for openSUSE 11, if it’s any good I’ll upgrade openSUSE 10.3 to 11. Else I’ll just shift to Debian or maybe even Gentoo.
    Debian has root account enabled by default? Read it’s disabled :?

  3. Kunal Gautam says:

    Man just learned how to enable and disable account and regarding sudoer file in my class :P

  4. PICCORO says:

    uff, sudo command has no users added in debian brands.. so this article is invalid, and only works in win-buntu…

    the file /etc/sudoers in debian, does not have entries for nobody, therefore no user is able to run the command sudo .. so, this does not allow him to make changes

    Subbu was right, u must use a real linux for future corrections in articles ¬_¬!

    More Info for a real linux distro : McKAY Debian and linux issues (packages and howtos)

  5. Bharath Ram says:

    vry useful info dude…………… for newbies of ubuntu out there…………

  6. mudfly says:

    in regards to disabling the root account, which I am a fan of, you can still use sudo su - to switch to the root account, when needed.

  7. Vinayak says:

    "Enabling And Disabling Root Account in Debian/Ubuntu" – http://bit.ly/9heegi (via @Apture)

You can leave a response, or trackback from your own site.

Leave a Reply