Sections

  • About Author
  • Contact
  • Debian Hosting
  • Popular Posts
  • Privacy Policy
  • Sitemap

Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

Categories

  • Backup
  • Database
  • Free-Tools
  • General
  • Monitoring
  • Network
  • Other Linux
  • Package-Mgmt
  • Paloalto Firewalls
  • Security
  • Webserver

Enable and Disable Ubuntu Root Password

Posted on September 28, 2006 by ruchi 90 Comments

Ubuntu is one of the few Linux distributions out there that will not enable the root account.If you want to do something with root permission on the console you have to type sudo before the command.


sudo” means superuser do. “sudo” will prompt for “Password:”. Please specify user password

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 distribution installation process.Because of this your root accout is inactive.

If you want to enable root account (which is not recommended) enter the following command.

$sudo passwd root

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

If you want to disable root account in ubuntu you need to lock the root account by using the following command

$sudo passwd -l root

If you want to work on a root console you’d better use the following command

$sudo -i

Related content:

  1. forgot root password or reset root password in Debian
  2. Howto restrict su command to superuser only in Linux
  3. How to Reset debian Root Password
  4. Recover MySQL Database root password
  5. how to change root password in debian

Categories: General, Security

Tags: disable-root-account-ubuntu, enable-root-account-ubuntu, Security, sudo-ubuntu

90 thoughts on “Enable and Disable Ubuntu Root Password”

« Older Comments
  1. mathi on December 10, 2009 at 9:24 am said:

    i am using ubuntu (GUI). i was lost my password. so howto retrive my password. but i now the user name. please help me.

  2. Joe on December 23, 2009 at 4:37 am said:

    when i installed ubuntu originally it asked to create a user acct but i did not assign a password to it. so when i enter any sudo command it asks for the user password so i just hit enter and then the command doesn’t execute. how can i add a user?

  3. BakiShamil on January 14, 2010 at 3:42 am said:

    thierry Says
    May 8th, 2008 at 9:03 pm

    thierry…I just want to say thank you so much from newbie like me, making instructions so clear and direct. I was bale to find it and enable it in Ubuntu OS. thank you so much.

  4. Philip_Musgrave on January 26, 2010 at 4:51 pm said:

    I just recently installed Ubuntu 9.04 and had a few major problems, but upgrading to 9.10 (Karmic Koala) solved the worst (display res stuck at 800×600) – so I am now moving on to more important things, such as using the root access to run a few commands, and this discussion has proved to be most informative. Thank you (I will NOT be enabling a root login). (also, got a few chuckles from some of the more vociferous posters) – my background is I started with Atari DOS, then IBM with DOS 2-5 and all of the various Windows versions… cursing Microsoft pretty much for close to 30 years. Ahh, finally an OS that works and doesn’t try to be my nanny!

  5. Jason Fowler on February 5, 2010 at 1:34 am said:

    Ubuntu users (and I assume it will work for Debian users too) should use the following command to lock the root account: sudo usermod -p '!' root

  6. GIJ on February 13, 2010 at 12:01 am said:

    i give up, one week and i still dont feel linux. all because of the “root issue”. back to my beloved custom distro.

  7. John on February 28, 2010 at 10:37 am said:

    On Ubuntu (9.10) you do not have to do this in a terminal.

    On the top menu bar click System/Administration/Users and Groups.
    In ‘User Settings’ Window select root, and click the keys button (click to make changes).
    In ‘Authenticate’ window supply your password and click the Authenticate button.
    In ‘User Settings’ window click properties.
    In ‘Account Root Properties’ select ‘Account’ tab.
    On ‘Account’ tab select ‘Set Password by Hand’.
    Enter your password in both the password and confirmation box, and click ok.
    In the top right hand corner of the screen, click your user name. From the drop down menu click ‘Switch User’.
    On the new login screen click ‘Other’, give user name ‘root’ and enter your password. you are now logged in as root.

  8. David Dyess II on May 1, 2010 at 5:03 am said:

    Guys I sometimes need a GUI root session so I log out and then select other where it askes for the user and pur ( ROOT ) and enter the password and then I have a Root GUI.
    This may be old news but it is new to me.

  9. Marcus on May 1, 2010 at 5:42 pm said:

    Seems a bit weird that a Debian forum is dominated by an ubuntu discourse omg. I often wonder how many Windows(tm) users inadvertently delete their C drives? Not may I would think. The more I poke about in the ubuntu/kubuntu world for research the less I understand it and the less I like it. The reason is this. In a perfect world new linux users would be buying pre installed dedicated linux comp. For most users that would give them an experience parallel to their purchasing habits of other proprietary systems. But they don’t. What they do is want to try linux on the existing comps. Right of the bat they encounter partitioning and multi boot issues. Now consider that grub2 writes to the mbr and frequently borks and fails to boot after OS installs. All of this is tricky stuff for newbies and it is classical command line territory. So how does ubuntu position itself in the market place to meet this challenge? IT DISABLES THE VERY THING YOU NEED MOST. I have to add if I was a billionaire philanthropist dedicated to the linux community; then disabling root accounts would not be my first thought. But nor would I contemplate putting window controls on the top LEFT of the windows ffs. As I am in a rant I may as well finish off. IMHO ubuntu has serious/technical branding issues to do with the way they handle two major desktops. Half the k stuff files are still called ubuntu….plus they now have multiple color palettes and names. I would have gone with ubuntu k and ubuntu g – one forum – one color palette – one brand – one user experience.

  10. Keithen on May 2, 2010 at 8:15 pm said:

    Ok im 16 and some computer guys at a job interview talked me into linux and told me to download ubuntu. I have my computer set up to dual boot windows 7 and ubuntu ubuntu as primary, while downloading it it asked for me user name keithen and a password i didnt put anything for the password and now it keeps on asking me for a password that i never set. i have tried everything and all i get is

    keithen@keithen-laptop:~$ sudo passwd keithen
    [sudo] password for keithen:
    Sorry, try again.
    [sudo] password for keithen:
    Sorry, try again.
    [sudo] password for keithen:
    i dnt know were to set it or anything

  11. Eric on May 11, 2010 at 10:49 pm said:

    Keithen

    you don’t need sudo to change your own password, just use

    $ passwd

    then you will be able to sudo if required using the password you just entered

  12. Bobcorps on June 29, 2010 at 8:58 pm said:

    I just got a new laptop from a friend who recently passed away. Geeze, he didn’t leave me a password, so now I have this 3.5 pound paperweight. I can’t play my DVD’s because Ubuntu wants a password, I can’t change anything, because of the stupid password bull. How does one disable the password feature, without entering another password?

  13. keithen on July 18, 2010 at 1:39 am said:

    if he didnt set one you will have to reinstall linux or its useless…doesnt take long if you set a password you wont have a problem with the root and i didnt have to reinstall it there is another way to go into the boot up and change it but i cant remember right now sorry

  14. Randall on August 9, 2010 at 11:57 pm said:

    I may have accidentally done usermod -p “literal pw aka no encryption” root….. and now I’m guessing my actual root pw is something totally random that the encryption thing generated from what i typed in… Is there anyway I can figure out based on what I typed in what my new root password is?

  15. andy2010 on September 8, 2010 at 7:14 pm said:

    new user to ubunto, i appreciate the root folder is designed to be hard to access, when i try some the above console tricks , im not able to type new password for root, (just like J3sus who left comment above)

    Im having problems with my Nvidia graphics drivers , not happy with the resolutions available to me and to try a “possible newer driver for card” i need access to the root folder.
    because i have a NVIDIA-Linux-x86-256-53.run file which apparently needs to be placed into a folder located in the root folder so that the system can fire up the driver. something on them lines! im complete novice and new here. appreciate some help. be nice to have good highish resolution available. hellishandy

  16. anonymous on September 13, 2010 at 11:29 pm said:

    If you need to change any passwords, just boot into grub and choose “Drop to root command line” and type “passwd insertusernamehere”

  17. odko on September 25, 2010 at 6:55 am said:

    hi all. i’m now using ubuntu 9.0. i was lost root password. And i need to work in root. so how to renew root password? please

  18. Ryan on November 8, 2010 at 8:35 pm said:

    What I want to do in ubuntu is get rid of that silly authentication window and enable my root user. I’ve enabled the root user part… how do I get rid of the authentication window. It pops up just about everytime I try to configure something. What’s the point? If I’m a hacker and on my system.. I’ve already got away around my password. Asking for it again serves no purpose. All it is is a hassle to a user trying to do something legitimately. I mean.. i’m fine with the command prompt. It’s my preferred way if I’m remote, but one of the reasons for going to gnome is to use the desktop gui to handle some of these things. With that authentication window poping up every 5 seconds, it ends up being faster using the command prompt. If that’s the case.. what’s the point of having the GUI at all? We might as well go back to the late 80’s and grow mullets.

    Sorry… ubuntu is annoying.

  19. GTGrover on November 15, 2010 at 9:43 pm said:

    I like the sudo option, even with automatic login. People who have access to my machine can not perform admin operations.

  20. socialflea on November 20, 2010 at 6:10 am said:

    Ryan,

    Is it any more annoying then in windows you are prompted even when you don’t have a password set?

  21. john on January 22, 2011 at 5:47 am said:

    ubuntu is asking for a password and an authentification code and I never set one up upon installing it–what can I do

  22. Ridwan on February 6, 2011 at 1:03 am said:

    Hi All.
    I have a problem with my “root” password, i lost it..
    when i use sudo to change it,

    operator@plik-server:~$ sudo su

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

    [sudo] password for operator:
    Sorry, user operator is not allowed to execute ‘/bin/su’ as root on plik-server.

    each time i use “sudo” then it always says “Sorry, user operator is not allowed to execute ‘/bin/su’ as root on plik-server”

    i tried use kon-boot and NT Offline Password to reset password “root” but it didn’t work..
    Help me,
    Thanks

  23. Mardur on May 3, 2011 at 2:03 pm said:

    Ridwan, are you allowed to call any command with sudo? The file /etc/sudoers should contain something like “%wheel ALL=(ALL) ALL” and you should be member of the group wheel. Try “sudo bash” or “sudo -i” instead of invoking su. Or directly use “sudo passwd root” to set a root password.

    If you want to set a new root password without knowing the old or having access via sudo, you can do the following in the GRUB bootloader:
    Select your linux entry in GRUB and add “1” in the list of optional kernel parameters. This will load the single user mode, which is a root console. Then use “passwd” to set a new password (you don’t need to know the old one).

    If the console asks you for the root password to login, then try another kernel parameter “init=/bin/sh”. This should prevent a regular login prompt and push you directly to the command line. Then call
    mount -a
    passwd

    reboot

    This worked for me on Ubuntu as well as SLES.

    If all fails, you can always boot your system from a Live disk, become root there to mount and chroot to your harddisk. The command “passwd” as root will then set a new root password on your harddisk.

    Ubuntu puts the first created user automatically into the wheel group and configures sudo accordingly. You should never need to login as root.

  24. gowtham on August 1, 2011 at 10:51 am said:

    how to recovery the root password in ubuntu10.04

  25. Kyle Maes on August 4, 2011 at 8:17 pm said:

    Thankyou for actually being smart now i can install gstreamer0.10-XXXXXX it didnt let me before

  26. Mumbi on August 12, 2011 at 12:14 am said:

    I got a pre-installed ubuntu (meenee) laptop from amazon this year. Its asking for a password and authentication key which I dont have and never enable. What do I do? There are programs that need to be activated but I can not because of the keys being asked for.
    by the way, I am using ubuntu linux for the first time!
    thanx!
    Mumbi

  27. MMistry on September 19, 2011 at 8:11 am said:

    We have a server which has 4 users and they all have their own login and pass word.but root login and password are known to all users so by opening root login people they are opening some important documents which they need not to
    Please guide me what to do with my own login and password such that even from root also the documents can not be opened!!!

  28. AKshay on September 20, 2011 at 12:56 pm said:

    Hello ,
    i have ubuntu 11.04 . i am not able to see password window(field). maybe its hide :(.. how i able to login ?

  29. Mitesh Patel on October 17, 2011 at 8:18 am said:

    Thanks

  30. Charles on October 27, 2011 at 8:23 am said:

    this is a nice tip….its better to use the sudo -i command than to enable the root account

  31. yogeshwaran on December 9, 2011 at 8:59 am said:

    i am using the red hat 6 ,i want to know the root password with out permission of administrative pls give the commands

  32. baba10 on December 26, 2011 at 3:39 pm said:

    why all of u want to mess up with root things??dough,…If u dont really have an emrgency times,i aware you that going around with root things made u all being the root human of Nux..So low-face,eye-glasses,eat popcorn everyday,just married with rectangle blue shape bright and drink the electrical source.Live but not life,..

  33. Putsoa on December 28, 2011 at 6:29 am said:

    Open application terminal and just type passwd, then you will be required to type in your new unix password, it should be able to enable your password. Root is an administrative function so you should be having administrative rights to execute root commands.

  34. JeffKaye on January 24, 2012 at 4:53 pm said:

    I set an admin password on my account. Then I decided to run it as “no password required”

    Now I can’t unlock the admin acct at all. It asks for a password that isn’t there. I’m new to Ubuntu so please go step by step.

    Thanks

  35. getreu on May 4, 2012 at 6:02 am said:

    Since most programs uses gksu to gain root privileges (which points actually to gksudo) giving a root password is not enough. You will still be ask for the old password as long as the account you are logged in is part of the admin group.

    Here the complete procedure to set up a root password:
    1. login in the account that is allowed to gain root privileges
    (the one you have set up first during ubuntu installation, assume it
    “mandy”).

    2. Open a terminal and type
    >sudo passwd

    3. Type the new root password twice.

    4. make gksudo and other programs use the new password:
    Delete “mandy” from group “admin” in /etc/group.
    This can be done graphically with
    Start -> System -> user and groups

  36. N4RPS on June 9, 2012 at 6:08 am said:

    I needed to change my password to lowercase characters, but it wouldn’t let me change it due to the minimum length requirements in passwd. This suggestion to activate root allowed the change.

    Don’t need this all the time, so I disabled it again. So, in a pinch, this CAN be useful…

    73 DE N4RPS
    Rob

  37. John on June 12, 2012 at 4:24 pm said:

    haha root can see all files. why dont you change the root passwd so no one else knows it

  38. Jim on September 5, 2012 at 9:43 pm said:

    A Pogoplug has 1 account and 1 password. Root. If you try to ssh into your Pogoplug from a user account you won’t get in. The account you come from has to be named root. Easy enough to do from Debian or Red Hat, but impossible from Ubuntu or Mint unless you’ve set up a root account.

  39. Roland Giesler on October 17, 2012 at 11:20 am said:

    Ryan, if you’re such a hardcore hacker as you’re claiming, you should log in as root and load Nautilus or the whatever as root. Or modify your menu commands. Really, you’re whining like a noob.

  40. wilmer valentin on December 13, 2015 at 8:21 am said:

    Im using ubuntu 15.04 and everytime i install apps it requires me to put a authentication password that i didnt know at all what will i do?

« Older Comments

Leave a comment

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

« Remove unnecessary Files in Debian and Ubuntu Using localepurge
Install libdvdcss and w32 video codecs in Debian and ubuntu »

Sponsored Link

    Cheap Web Hosting

Categories

  • Backup
  • Database
  • Free-Tools
  • General
  • Monitoring
  • Network
  • Other Linux
  • Package-Mgmt
  • Paloalto Firewalls
  • Security
  • Webserver

Sponsored Link

Archives

Sponsored Link

Favourite Sites

Ubuntu Geek
  • About Author
  • Contact
  • Debian Hosting
  • Popular Posts
  • Privacy Policy
  • Sitemap