Enabling And Disabling Root Account in Debian/Ubuntu


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!
Possibly Related posts:
There are lots of times where you'd want to mount
Sun Microsystems is on a major Open Source Acquistion spree.
The official openSUSE forums has been established and went live
I had encountered this problem on sudo/gksu not working few months earlier. Whenever
Corey Burger continues in the 4th part of his series,

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

6 Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>