About Linux FAQ

Browse More FAQs:

Ubuntu Linux root password - default password

Posted by Vivek Gite [Last updated: December 17, 2007]

Q. I have just installed Ubuntu Linux. But, what is the default root password? I can only login as a normal user.

A. This is the mystery for most users - you didn't set a root password, so what is it?

The root user can do anything as this a/c has full access to system. So using root account for daily work can be dangerous.

To be frank root a/c is locked by default under Ubuntu Linux. Therefore, you cannot login as root or use su - command to become superuser.

To run all administrative command use sudo command. sudo allows a permitted user to execute a command as the superuser or another user. Ubuntu setup your default account (the one created during installation) to run all administrative commands.

For example create a new user called bar, you need to type sudo command as follows:
$ sudo adduser bar
Password:

When sudo asks for a password, it needs YOUR OWN Password; this means that a root password is not needed.

Here are few more examples.

Task: Start / stop / restart services stored in /etc/init.d/ directory

$ sudo /etc/init.d/ssh stop
$ sudo /etc/init.d/networking restart

Task: Avoid typing sudo each and every time

Note that this is not recommended until and unless you are an expert and aware of what you are typing:
$ sudo -i

Above command will start /bin/bash as a root shell so that you can enter a root user command w/o using sudo.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. James Says:

    I have also found “sudo bash” useful as an alternative to “su”.

  2. tom Says:

    or you could…

    sudo passwd root

    then enter your user password you created when you installed then you will be asked for the ROOT pasword (2x) enter it here and you can log in as root.
    While I appreciate the ’security’ linix (ubuntu) offers - I don’t like being treated like an idiot

    Tom

  3. nixcraft Says:

    Tom,

    Hee

    I understand your point. Not everyone is poweruser. Many user are new; so to avoid damage this sudo thingy was introduced.

    Appreciate your post.

  4. Joel Says:

    thank-you for the post Tom this has helped a gr8 deal. We can definately appreciate what ubuntu has done with the sudo command to help bring more windows users to the linux environment. Thank-you ubuntu!!!

    Joel

  5. Ranjith Says:

    Tom,
    Thanks for the post. I was breaking my head for the past 1 day on how to login as root. I mostly work on Networked systems in Office and I was worried I couldnt login as root even on my home pc.

    Thanks again!!

    Ranjith

  6. Greg Says:

    “sudo su” will also work.

  7. Winf Says:

    hi guys

    unfortunately

    i always seem to get ” username is not in the sudoers file”
    or when i try sudo su etc i get “sendmail: fatal:open /etc/postfix/main.cf: no such file or directory”

    any help overcoming this for a new user would be great.

    thx in adv
    W

  8. madis Says:

    well i have a problem…i can’t use sudo command with my user (id 1000), it starts shouting that you need poweruser rights…

  9. Radu Floricica Says:

    i always seem to get ” username is not in the sudoers file”

    Same here. Apparently it’s a known bug. The quickest fix is to install, from the optional servers, only OpenSSH. Don’t install lamp, mail, dns or any of the others. You cand of course add them later with apt-get.

  10. Bob Says:

    Hmmm…either I don’t have any idea what I’m doing or nobody else does. I think it’s safe to say the problem is me.

    I’ve installed Ubuntu 7.04 numerous times, and each time without exception when I’m prompted for the root password (whether because I’m trying to log in as root or because I’m running the SU command) and I type in the password I specified for my user account, it doesn’t work.

    I can repeatedly log in as myself using my password without any problems at all. But as soon as I type SU in a terminal and I type that VERY SAME password in, Ubuntu won’t take it.

    Sorry, but I have a hard time reading post after post saying my user password is, by default, the same as the root password, when Ubuntu doesn’t seem to think so.

    Again, I’m sure the problem is me, but I have no idea what to do.

    Thanks,
    Bob

  11. vivek Says:

    Bob,

    su command is outdated. You need to type the following command to become root user (enter your own account password):
    sudo -i
    or
    sudo bash

    HTH

  12. venkat Says:

    in ubuntu linux you can unlock the root user by resetting the root password

    use

    sudo passwd root

    (This will ask for the sudo user password and then the new UNIX password, which will be your new root password)

    once password is reset do

    su - root

    and enter the new root password it should take you in as root.

  13. Kathy Says:

    thanks a bunch! Have been learning Linux/Ubuntu for a class and using a Live Cd. Couldn’t use the su command but with your post was able to get to the root and complete my lesson!
    Thanks again.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

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>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.