Ubuntu Linux root Password – Find default root user password

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

It is the mystery for most Ubuntu Linux users. You didn’t set a root password, so what is it? The root user (also known as superuser), is a user on Ubuntu Linux and Unix-like systems with full administrative privileges (full access). So using the root account for daily work can be very dangerous, and you may damage your working system.
What is the default root password on Ubuntu Linux
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Ubuntu and sudo command
Est. reading time 4 minutes

Ubuntu Linux and root account password

By default root account is locked under Ubuntu Linux. Therefore, you cannot log in as root or use ‘su -‘ command to become a superuser. To run all administrative command use the sudo command on Ubuntu. 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

When sudo asks for a password, you need to supply YOUR OWN password. In other words a root password is not needed. Here are few more examples.

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

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

Avoid typing sudo each and every time on Ubuntu Linux

Note that this is not recommended until and unless you are an expert and aware of what you are typing or doing:
$ sudo -i
$ sudo -s
Above command will start /bin/bash as a root shell so that you can enter a root user command without using sudo command. Where, sudo command options are as follows:

  • -i : Run the shell specified by the target user’s password database entry as a login shell. This means that login-specific resource files such as .profile, .bash_profile or .login will be read by the shell.
  • -s : Run the shell specified by the SHELL environment variable if it is set or the shell specified by the invoking user’s password database entry. If a command is specified, it is passed to the shell for execution via the shell’s -c option. If no command is specified, an interactive shell is executed. Note that most shells behave differently when a command is specified as compared to an interactive session; consult the shell’s manual for details.

How do I login as root user?

Open the terminal application and simply type the following sudo command $ sudo bash
$ sudo -s
Supply your password and you will become a root user.

So, what is the default root password for Ubuntu Linux?

Short answer – none. The root account is locked in Ubuntu Linux. There is no Ubuntu Linux root password set by default and you don’t need one.

Long answer from the official wiki page:

By default, the root account password is locked in Ubuntu. This means that you cannot login as root directly or use the su command to become the root user. However, since the root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in – it allows authorized users to run certain programs as root without having to know the root password. This means that in the terminal you should use sudo for commands that require root privileges; simply prepend sudo to all the commands you need to run as root.

But, I still want to set up a root password on Ubuntu. Can you tell me how do I do that?

Sure, type the following two commands:
$ sudo -i
Type your own password when prompted, and then you will see # prompt. Now you can set up the root user password by typing the following command:
# passwd

Summing up

There is no root password on Ubuntu and many modern Linux distro. Instead, a regular user account is granted permission to log in as a root user using the sudo command. Why such a scheme? It is done to increase the security of the system.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 132 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
132 comments… add one
  • James Sep 28, 2006 @ 12:34

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

    • Kiran May 26, 2011 @ 14:47

      It indeed works! Thanks mate!

    • Raja Mar 20, 2021 @ 11:42

      Thanks, buddy!!

  • tom Oct 14, 2006 @ 2:35

    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


    • Anonymous Jul 8, 2010 @ 20:11


    • Michael Zhu Sep 6, 2010 @ 12:45

      to Tom,
      yeah, thank you ,Tom. you are right. we need to config root password by ourself through typing sudo passwd root in terminal… it works…lol….

      • Sutti Dec 29, 2010 @ 21:12

        If you forgot to logout your ubuntu. Some one will able to type sudo -i and do anything he want.

        • WhiteVandal Jun 26, 2013 @ 19:31

          Yeah, you’re right, if you forget to log out and walk away from your station, you deserve to have everything wiped. Be responsible. Face the consequences when you make mistakes. I’m not perfect, but I accept what comes when I screw up.

    • Jeremy Oct 1, 2010 @ 20:53

      You are awesome Tom. That is exactly what I wanted.

    • matias Dec 23, 2010 @ 5:24

      thnx tom!!! you save me

    • GhaV Jan 8, 2011 @ 20:34

      WOW this is great TOM I thank you. Even if myspace sucks :P lol

      • Ron Damato May 7, 2011 @ 2:46

        I fucking hate Linux, it’s for stupid people to wimpy to and poor to run Solaris. Fuck you all! NERDS CITY!

        • A Name Aug 29, 2014 @ 6:48

          Lol you think that the other cares about what you saying? So shut up

        • jimbo Sep 15, 2014 @ 20:13

          I think you meant “too” Solaris smart guy.

    • saif ur Rehman Apr 19, 2011 @ 6:32

      thanks . it will help me a lot.

    • kevin Jul 10, 2011 @ 18:54

      hi i just did a root login for a friend cause she didnt remember the password and i cleared that but now it shows up 2 different blue login screens for passwords how can i clear all that so it can load u p a normal boot…

    • Armand Oct 1, 2011 @ 9:15

      Thanks a lot Tom

    • sunil Nov 11, 2011 @ 17:01

      Thank You Tom :)

    • seenu Jan 31, 2012 @ 8:19

      Hi Tom,

      What is the default password for SU command?
      am unable to use that password as “root” for SU,it is displaying as “Authenticaion failed”.
      Could you please guide on this

    • danek731733 Aug 14, 2013 @ 17:21

      Thank you! That’s what i needed.

    • pak Jul 16, 2014 @ 14:13

      thanks To it works..!!!!!

    • ROCKY Apr 11, 2016 @ 21:07

      thanks bro…

    • Pawel Apr 29, 2021 @ 10:45

      Indeed, this solution is even worse when think, that when someone/something get to know normal user password then he/she/it can run anything by giving same password.
      There should be normal user account and root account with different passwords by default. And such articles would not be needed.

  • 🐧 nixCraft Oct 14, 2006 @ 10:52



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

    Appreciate your post.

  • Joel Dec 30, 2006 @ 18:49

    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!!!


  • Ranjith Aug 4, 2007 @ 14:57

    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!!


  • Greg Dec 17, 2007 @ 0:05

    “sudo su” will also work.

    • Ron Damato May 7, 2011 @ 2:49

      HAHAHAH No it won’t you dummy! Learn how to spell in Linux. Its sudo -8 not chmod 564 to permissionize the categories, i know what im talkin about., im in linux class liver 2 and can add users faster than any of you

      • Anonymous Oct 7, 2020 @ 20:27

        isn’t this the same asshole that was cussing everyone out 9 years ago?

  • Winf Dec 20, 2007 @ 11:43

    hi guys


    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

  • madis Feb 25, 2008 @ 8:45

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

  • Radu Floricica Apr 8, 2008 @ 9:16

    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.

  • Bob Apr 11, 2008 @ 17:49

    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.


  • 🐧 nixCraft Apr 11, 2008 @ 18:39


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


  • venkat Jun 30, 2008 @ 15:24

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


    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.

  • Kathy Jul 4, 2008 @ 3:13

    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.

  • Greg Aug 18, 2008 @ 0:45

    You didn’t answer the question.

  • Mike Sep 23, 2008 @ 17:00

    “MICROSOFT!!!!” doen’t protect you from your administrator account. Where is the FREEDOM that Richard Stallman talked about Freedom to mess my system up if i want to??

  • dave Nov 4, 2008 @ 12:45

    UAC in vista prevents a local administrator from running their shell\environment with their administrative ‘token’ during normal use. If they perform an admin task, UAC prompts the ‘administrative’ user to click ‘Continue’ or equiv (thus temporarily ‘grabbing’ their admin token).

    If user is NOT a local administrator, they must enter credentials of a local administrator.

    Kind of like sudo…. ish.

    Vital move on MS’s part. And over time will get users into the right from of mind eg. principle of least privilege – if they know it or not.

    Windows users have been used to having ‘full access’ by running as administrators. also means they get broken computers more quickly!! that has had to change.

    brings windows more inline with *nix security model. which can only be a good thing imho – everybody wins except the malware authors.

    windows boy through and through (enterprise admin for 6 yrs), just starting my journey into linux and chose ubuntu. a few frustrations but loving it so far.

  • mr.fucaway Dec 1, 2008 @ 16:59

    int good day () {

    printf (“i have one question
    are there any one can
    give me cure to solved
    my problem i wanna be
    login as root nothing
    a less are this
    available on Ubuntu
    so what my question i
    repeat is i can login
    root itself not as
    root ? i wait for
    answer !!!!!!!!!!!!\n”);

  • Ryan Dec 24, 2008 @ 5:32

    i installed linux but i put a password on the root and made the admin acount that i started with a limited acount and i cant get in to the root and cant access what i need in the limited account any guesses i’ve tryed everything you guys suggested but still cant get in

  • bla Dec 26, 2008 @ 23:25


    error: function "main" is missing
    error: function good: day is a bad input.. shall it be "good (day)?" Still.. the variable "day" is undeclared
    error: function "int good" doesn't return any value

  • Muhammad Danish Khan Jan 2, 2009 @ 13:15

    Hello all,

    I have installed ubuntu 8.10. it working fine but there is problem that whenever i reboot my system it not retain all the values those i setup last time.
    e.g Network IP setting , proxy setting even the softwares those i installed last time.

    it just makes ubuntu like fresh install

    how can i fix it
    please tell.
    Muhammad Danish Khan

  • 🐧 nixCraft Jan 2, 2009 @ 13:59


    You must be booting from CDROM.

    Once booted, you need to install Ubuntu on hard disk and after that remove disk from a CDROM.

  • mr.fucaway Jan 31, 2009 @ 8:47

    Sorry for late
    And by the way my problem
    Is solved with ubuntu how ??

    It’s simple to set root password
    Write this command

    username@localhost-desktop:~$ sudo root
    [sudo] password for username:

    here put your own password ok
    output system must be as this

    username@localhost-desktop:~$ root: command not found

    Now you are resetup root password
    Root in ubuntu not support for
    Login gui mode so you must
    Allowed to adimistrator login gui gnome
    write this command
    gksu /usr/sbin/gdmsetup
    And enter your own password
    Go to tap security and do check on this
    Allow local system administrator login
    Now just close and press Crtl+Alt+Backspace
    Now you logout and login with root and your password
    Good luck for all
    e-mail is mr.fucaway@gmail.com

  • Alan Feb 24, 2009 @ 14:31

    On the “root” login issue – I have just loaded ubuntu 8.1 (downloaded the install CD, booted from CD and hey presto an OS that actually works! a machine that is ten times faster than (spit) Vista! Anyway I digress, having remembered some Unix stuff from long ago I did the following:
    sudo passwd root
    (Enter my OWN login password)
    you are then prompted for your UNIX password
    (enter this twice)
    you are now superuser root
    (exit to return to normal user)

    Please be aware you can do lots of damage as superuser so only use if absolutely necessary and exit as soon as possible! Oh by the way I really love the multiple “Desk” options, I now have one for browsing, one for mail, one for other work and one showing Wallace & Gromit films.


    • backdoor Jul 31, 2010 @ 7:03

      excelent work.dude… it worked.. Ive changed IP and setup proxy.. enjoying with Internetttttttttttt…

  • andrea Mar 25, 2009 @ 13:07

    I thank Tom for suggesting the
    $sudo passwd root
    command. (That’s what I was looking for, an answer to:
    Q: can a generic sudoer change root password, or not because of some security reason? )
    I agree that an user with non-so-bad linux skills should run this command just after any ubuntu scratch installation, and have an “ordinary” superuser account, to use with consciousness when doing big administration stuff. However, it’s my impression that the “sudoers-thing” is not bad, even if you know what you are doing… sometimes you just want to be super-user for a single command (e.g. “sudo synaptic”)

  • modwerdna Apr 17, 2009 @ 2:07

    Ok, so if I understand this , root user is protected and no one can login that way?

    But if that’s the case- why did my mass storage slave hardrive get installed that all it’s files are as root ownership. That makes it so that I cannot set permissions on any of those files?

  • StevenCP May 18, 2009 @ 23:32

    Believe it or not, this is a rather annoying issue.

    Let me say this: This assumption that Ubuntu makes in limiting access using what amounts of vague commands to the novice user is redundant, as the novice user doesn’t know anything about the vague commands of Unix, Linux, etc.

    Having personally worked with Unix for over 25 years, I find my situation infuriating to say the least.

    So, here’s the deal: I did a moduser and changed my groups. Unfortunately I forgot to include the ‘admin’ group in the -g list, thereby (and I am assuming here) I was removed (?) from the sudoers file.

    So, my one and only user no longer has admin privs and/or cannot access sudo because of this file. So, I cannot mod users, modify the sudoers file, update, or just about anything without the #$%^$#@ root password (see first note above.)

    So, reading this page has been somewhat amusing since at least one person has stated (without any solution) that they do not have access to modify the suoders file. I hope there is a simple solution to this, because if I have to reinstall the system I am really not going to be happy.

    For you techies, think of this as a semaphore-resource lockup issue.

    The duality of the sudoers file without a secondary command to change that file without actually requiring the file is… shortsighted, and obviously remains and issue based on the number of posts regarding this issue.

    • 🐧 nixCraft May 19, 2009 @ 0:09

      No need to reinstall OS. You can reset and gain root / admin level access. See Ubuntu Linux Restore admin / root level permissions


    • rolando Nov 23, 2010 @ 16:33

      You pulled a dumbshit move like that and claim to have 25 years of Unix experience?

      I call shenanigans.

      Why are you using Ubuntu, anyway? And do you not see how idiotic it would be to NOT require root/sudoer access to the sudoer file?! ANYONE and ANYTHING could modify it.

  • StevenCP May 19, 2009 @ 2:13

    Thank you. That did it…

    Seen on a global level, I understand that there is a need for security and to try to prevent certain actions that a typical user might screw up. However, Linux (as a mostly command-driven OS) and even in its GUI form is a bit more difficult to permamently screw things up with all the command-line options.

    If you were to *cough* take Vista as an example of an OS trying to be more intelligent than the user and continually ask questions that either the knowledgeable user may know, or the noob wouldn’t know anyway – it just doesn’t work. Trashing your system is a right and a priviledge; we shouldn’t force the user to make security decisions. After all, that’s how you learn – mess up the OS a few times and you WILL learn. And if you’re in a position of authority to blow away something important, well, that’s why there is backups that no one really ever does either…
    My $.02

  • Ubuntu je zakon Jun 1, 2009 @ 17:50

    Ubuntu is the best OS, but I use Kubuntu, Ubuntu with KDE!

  • MarSys Jun 3, 2009 @ 14:31

    I have doubt… Can someone unlock my root account remotely?

    Thought that the user account created on the installation steps was the root.. but no! :(
    Anyway-.. it’s better to lock root instead of leaving it unprotected (with no password) like on some old linux distributions..

  • cipher Jun 27, 2009 @ 18:09

    Ubuntu normally restricts access to the the root account and we have to run the sudo command to execute all commands . So how do we break out of this .
    reboot your system and boot the ubuntu box in RECOVERY MODE . then choose the option root shell with networking .
    now one u select thats the system will boot to the root shell ( almost like the single user mode with networking )
    Note : Its might try to set up networking ,just wait for sometime .

    the one youe reach the hash prompt i.e # gibe the commands passwd n change the root password
    # passwd
    Enter New root password …
    And Hurray ! one ur logiin to your ubuntu account
    give su – and your new password for root and u get a roots prompt #

  • Bob Swift Jul 10, 2009 @ 14:49

    The problem for administrators who are NOT command line experts is that all the nice GUI support that is available cannot be used easily. Every time I try to do something I need as an administrator, I can’t do from the GUI. Either I have to google the equivalent sudo command or find the GUI tool name and run gksudo to run it with more authority. Then I have a desktop with multiple tools open some with more authority than the other. Same for other tools like pgadmin. A Windows administrator wouldn’t put up with that for long.

  • Jon Jul 24, 2009 @ 15:39

    i just wiped my system of Microshaft Vista. proud to be a new user of Ubuntu on a laptop that only ships with Vista. im generally in Centos but i wanted something a bit lighter for my laptop. i even bought a Solid state drive for my laptop just for my selection of linux, which is now Ubuntu. i just spent the last 20 min trying to log in as root also. thanks for the SUDO info. ill just have to remember not to type Sudoku…lol

  • digit Aug 13, 2009 @ 22:58

    thans a lot!!!



  • Dickson Rwehumbiza Aug 17, 2009 @ 11:43

    I was being driven mad when i couldn’t log in as root on my own PC and also i was limited to run some of crucial commands.But the commands, “sudo bash”,has restored my joy when am in Ubuntu environments.
    Thanks a lot Ubuntu.

  • neetu kour Aug 27, 2009 @ 6:25

    Ubuntu How do I login as root user,how do I Login as root password

  • jay Aug 31, 2009 @ 17:21

    Thanks worked for me, my computer is at home, no one will ever use it but me. I need to use a WYSWYG HTML editor to build a web page. If i could not log in as root my software could not get at any of my files. what a pain in the neck !!!

  • graham Sep 10, 2009 @ 13:48

    This ubantu system makes windows vista look pretty good for functionality and ease of use. The rest of it becomes a horror story of authorisations command s which will not work and are totally not necessary. It will never challenge windows as it is not user friendly and the average user doesnt wont to spend all day trying to get permission for this and that with his own system.Even the entry screen is missing an easy to load menu.
    This system is written for totally computor literate operators who see it as a programming hobby and not as an easy to use tool. Cant even put the correct time on the clock without authentication/authorisation………..someone do us all a favor and get rid of this stupid feature which totally ruins the user experience
    The only easy bit about ubantu is that it loads easy and there it ends

  • Monica Sep 18, 2009 @ 14:56

    I understand that using linux as root can be dangerous, but I just installed it and I need to create a password for the root. I can not leave root with like no man’s land, because it would be even more dangerous.

    Understand that considerations about being root or not is second place when you have just installed the system. What you want most at this time is to make your system secure.

  • @graham Sep 18, 2009 @ 20:53


    I couldn’t disagree more. There are other distributions of linux out there which are very difficult for a user, for example, CentOS is terrible. A great server, but terrible workstation. I’m still a Linux noob, and I’ve had no trouble with Ubuntu so far. Sure I’ve had to Google a few things, but overall it’s very user friendly. While I agree that Ubuntu won’t ever have the market Windows has, I think that’s mostly because of a lack of exposure. Sure you have to get used to the menus and things look very different, but overall, I think Ubuntu is the perfect OS for a basic user who wants to be able to browse the web (safely), send e-mail, and create documents without selling their children into slavery to pay their Microsoft bill. As for typing in the password to make system changes, there are ways around that, Google is your friend. Also, I’m not sure how older versions may be, I’m speaking from my experience which has been on version 9.04. Good luck.

  • lao-zhao Oct 15, 2009 @ 6:31

    Very useful. Just want to summarise ways to become root in ubuntn :
    sudo bash
    sudo -i
    sudo passwd root
    enter bew UNIX password (your password)
    retype your password
    passwd: password updated successfully
    then type su – and password
    you become root
    next time when you want to become root you do not need to use sudo
    just su-
    after you add new user, each user can become root by using su –
    hope i make it clear

    • mohammed Feb 19, 2012 @ 18:24

      you make it clear bro

  • sara Oct 28, 2009 @ 17:29

    how i can access the root without password (hacking)
    in fedora

  • sas Dec 16, 2009 @ 9:56

    i forget my password in ubuntu
    how to chang it without known before password?

  • vinit Jan 12, 2010 @ 17:39

    thanks buddy

  • Mike Jan 22, 2010 @ 15:45

    what are the advantages an dis advantages of root login account

  • Mike Jan 22, 2010 @ 15:47

    please emplane

  • Cholin Wu Feb 26, 2010 @ 1:45

    Thank you for your post!

  • Megat Mar 11, 2010 @ 6:00


    How to perform maintenance when I do not know the root password.
    I can’t log in because the fsck of the root filesystem failed and need to be manually performed in maintenance mode with the root filesystem mounted in read-only mode.
    To enter the maintenance shell, I need the root password.
    Please help. Thank you

  • Nancy Finley Mar 16, 2010 @ 23:16

    I’ve read and tried every suggestion and everytime I get to the part where I put my password in it says sorry try again, what am I not doing or doing wrong. Trying to change root password.

  • Megat Harun Mar 17, 2010 @ 13:59

    Dear Nancy,

    I f you have installed Ubuntu, you can try running Ubuntu OS using CD first (booted from CD)and then open the bash terminal. Type the followings:
    sudo passwd root
    (You’ll be asked a password, enter your OWN login password)
    you are then prompted for your UNIX password
    (enter this twice, this would be your root password – superuser)

    Shut down and run the installed Ubuntu (not from CD). You can try to log in as
    root with the new password.

  • Johnny-Cracker May 21, 2010 @ 21:49

    After running most every distro, small & large, I’ve (not so quietly) settled into Ubuntu, though for some of my older stuff, most small Debian-based distros with LXDE, Openbox, jwm, Blackbox are still worth the tad of extra effort to flesh them out for serious computing. We are all spoiled with gobs of RAM & drive space, yet I still appreciate a small distro that just gets her done. Command line is where I started (back when kernel 0.95 in WGS Linux was 1st out), so isn’t such a pain & I actually enjoy most good CLI or NCurses based apps! Just my 9 cents!

  • Subhramani Jun 20, 2010 @ 3:00

    Pretty old post, but helped me even now!

  • Jennifer Jul 15, 2010 @ 8:36

    My brother reset all of my hard drive. When he put my files back on and put Ubuntu back on he didn’t have time to redo the bar at the bottom and the other Ubuntu things that took me a while to learn. I put the bar back, but it kept overlapping. I then just re loaded the newest firefox toolbar and then restarted the laptop. It came back on, typed in my laptop password. Then this command box appears in the upper left. Said jennifer@jennifer-laptop:~$ with the rectangle on it’s side. I tried my password. Then hslp,etc. I was able to enter new password with sudo passwd root, it said password updated successfully. Now what. I tried sudo bash when it said root@jennifer…. the rest, but the new password didn’t work. Help

  • Techpraveen Sep 27, 2010 @ 15:48

    I was searching for root user password :) Finally I landed here. Awesome post buddy :)

  • shanmukha Oct 18, 2010 @ 2:01

    i am shanmukha, i am able to creat a new user, but i ma unable to give password for it.
    after creating new user the passwd command line is coming but it is not taking any letters.

    • Ashish Nov 6, 2010 @ 8:26

      shanmukha when password line come what ever you type, that type in back ground…

    • Lohes Dec 14, 2010 @ 2:54

      Hi Shanmukha,

      I know this is pretty late to reply you. But I hope I can help u. Watever password u type in the command line will not be visible. This is just an extra security feature. So just have to type ur password and hit the [ENTER] button. Hope I helped:)


    • shanmukha Dec 30, 2010 @ 7:53

      thank u very much my proble is solved.

  • jame Feb 15, 2011 @ 16:52

    Total B.S. back to xp after running half ass for 12 months!

  • manish Mar 12, 2011 @ 9:01

    thanks alot….

  • Nico Apr 1, 2011 @ 17:49

    Somebody else set up my Ubuntu system – and I have since had it struck by lightening – I cant access the machine because I dont know either the user name or password – what are my options to install the drivers?

  • shawn Jun 7, 2011 @ 4:11

    thanks, mate. it’s enough for me.

  • Trilok Khanna Aug 1, 2011 @ 9:48

    Thanks Tom!!! very good article.. really appreciate it.

  • prasanth Aug 7, 2011 @ 8:30

    how to change the root password…can anyone please help me in knowing it!!!!!!!!!!!!!!

  • Fr0st Aug 22, 2011 @ 5:12

    Thanks man i dont know anything about Linux. Your a boss!!!! THANKS

    Dylan Laws (Mac,Windows,Android, and now Linux :P)

  • Sushil Rana Aug 29, 2011 @ 5:09

    Ya its working and so nice.


  • dinesh Sep 3, 2011 @ 5:42

    Thanksssssssssssssss bossssssssssss

  • niro Sep 7, 2011 @ 15:41


    each, the bug itself

  • danny Sep 11, 2011 @ 13:52

    hi folks,none of the above tricks worked out for me,help please?

  • tronyx Sep 25, 2011 @ 14:15

    Man, I’ve been looking everywhere for this info. New install and a noob at the keyboard, but hey, you have to start somewhere so thanks alot.

  • Sushil Rana Sep 27, 2011 @ 4:15


  • Phil Oct 14, 2011 @ 23:18

    This is a useful article! Thanks for discussing guys.

  • GJN Oct 15, 2011 @ 1:34

    I just installed a the ubuntu, 11.4 on our dell r810 server. It loads fine and I can login with my user name. When I go to root and attempt to update using sudo apt-get update, it says it cannot wright to a read only directory.
    Files locked!

  • GJN Oct 15, 2011 @ 1:59

    Error when attempting to do a apt-get install ununtu-desktop
    States Authentication token manipulation error
    Not using locking for read only file
    even with root access

  • Sam Dec 21, 2011 @ 15:36

    Thanks for that article.

    Nice to know.

  • Vijay Thakur Jan 21, 2012 @ 13:08

    thanx for such an important information,,,,,,,,,,it really work for me …….once again thanks

  • pradeepf Feb 5, 2012 @ 11:31

    I cannot use sudo anymore.
    What i did was disable password for my admin account ,still i am asked to enter password which doesn’t exist.
    Can you please help me !!

  • Sznur Mar 2, 2012 @ 8:03

    Awesome !! :)

  • Akshay Apr 30, 2012 @ 10:27

    hey,how can i logout after i login as a root user?

  • Randy Jun 21, 2012 @ 14:01

    Answers like this is why linux will never take off.
    If I need to set my own password HOW do I do it………………
    Thanks for Nothing.

    • Alex Aug 23, 2012 @ 6:09

      sudo passwd YourUser
      Prompt: old password
      Prompt: new password
      Prompt: confirm new password

    • plipax Aug 31, 2012 @ 0:23

      buang……. common sense please.. your hurting a person who supplies the answer..

    • Steve Sep 30, 2012 @ 1:06

      @Randy: USERS like you are why Windows will always exist, regardless of how many people use Linux. The article was not about how to change YOUR OWN password, it was about how to use the power of the ROOT user under Ubuntu, and the article answered the question accurately and efficiently, then you come up with an attitude, apparently in a fit of desperation after not knowing how to phrase your question to Google.

      Running their own Linux system isn’t for everyone. You have to have some basic computer aptitude. Perhaps you should try Microsoft BOB if you want a simple GUI based OS.

      Now, @Vivek, the original poster of this article – Thank you – It was EXACTLY what I needed, and of worked quickly and easily. Please dont let Randy’s attitude discourage you from posting more great tips.

  • Hostage Jul 17, 2012 @ 20:18

    Here’s what i did to set a root password on Ubuntu Linux:
    1. open a terminal window
    2. sudo -i
    3. vi /etc/shadow
    A. remove the exclamation mark on the first line (should be root) (x)
    B. save the file (:w!)
    C. exit vi (:q!)
    4. passwd root
    A. enter the password you want root to have
    B. Confirm the passwd

    • ndkilla Aug 17, 2012 @ 19:08

      dont know what all that is, but heres a nifty link
      Near the bottom of the page it says how to enable or set a password for the root user, i did it with 2 lines of test
      sudo passwd root
      then you can use
      su root
      and enter your password to login as root.
      a VERY simple way to login as root for the remainder of the terminal session is to use
      sudo su
      it logs u in as root with no password

  • edcompsci Aug 14, 2012 @ 17:31

    sudo passwd root

    will prompt you to change the root password, but you need your own password.

    otherwise sudo passwd [username]

  • alsjs Aug 31, 2012 @ 0:23

    buang….. dli pd ni mao..

  • Pushpa Sep 11, 2012 @ 12:52

    It really helps!!!

    Thanks a lot.

  • camilo Sep 15, 2012 @ 15:43

    On my Fedora 17 installation it won’t even allow me to use sudo since the account does not have admin rights. It won’t even allow me to shutdown the computer without admin rights (wtf), it only lets me suspend. I had to hard shut down the computer, boot into the kernel, etc.. I’m a developer and I have to use this system, but this is simply bad design, an average person would not stand for this.

  • steve Oct 5, 2012 @ 19:50

    i instal ubuntu 12.04,but it was automatically passwarded and i don’t no wat to do?

  • rxd06040 Oct 23, 2012 @ 18:07

    1 Add users
    1. Use the adduser command to add (at least) 2 new users. (You select & remember a pw.
    Create a name.)
    2. Show the new dirs in /home.
    3. Pick one of the users. Verify and document the account:
    a) What files are there?
    b) What is that user’s uid?
    c) Use su to “become” that user. Use whoami to verify. cd to their “home” dir and list their
    files. (^D to exit)
    4. Change the password of one of the users from your own account. Verify it was changed by su
    to their account again. (Hard to document since the old/new pw’s don’t show. Just document
    the process and prove to your self it changed.)
    2 superuser activity
    We want to add a file to all user’s accounts. We only have a few accounts in reality, but let’s pretend
    we have 100’s.
    1. Create the file. Make a file called “lab7.txt” with an editor (document your choice) and
    save to your own $HOME dir.
    2. Copy that file to all the other users in /home.
    • One command, not a bunch of commands. You can create a script, or one command.
    • If 1 command, xargs or find with -exec could be used.
    Hint: build the copy command for one, then add the find or xargs. Use -p (xargs) or
    “echo” to test it before you run it.
    • You can’t do this unless you are root. Ubuntu frowns on becoming root in a shell (#) but if
    you are going to pipe, you’ll need to. If you build a script, you can sudo.
    3. Use find to verify the files are there:
    $ sudo find …

  • darshan Feb 13, 2013 @ 19:16

    I have install ubuntu.
    my user name and password are correct but i didnt set my root password.
    when i want to install something , they ll ask root password. but i didnt get it.
    whats the way to recover my root password.
    any way to disable root password…

  • Gilad Feb 23, 2013 @ 13:44

    I’m running Ubuntu on VMware player.
    How do I set a password?
    If I try sudo -s or sudo bash it asks for a password. Anything I fill in is incorrect.
    How do I set this password in the first place?


  • Amy Mar 15, 2013 @ 5:04

    hie . . i am unable to type my password using the su command .. The cursor just gets stuck and when i press enter and then type is says Sorry Try again. .

    acer@ubuntu:~$ su
    su: Authentication failure
    acer@ubuntu:~$ *****
    No command ‘*****’ found, did you mean:
    Command ‘*****’ from package ‘mira-assembler’ (universe)
    ***** command not found

  • Irphan Apr 13, 2013 @ 10:33

    Hi All,

    Some one changed permission of /usr/ folder as recursively. Because of this all the folder and file changed their permissions too. Now i am trying to use “Sudo” , to perform writable command like apt-get , vi, chmod etc but terminal throwing a error every time.
    “sudo: effective uid is not 0, is sudo installed setuid root?”.

    Please help me out from this issue other wise i will die. :(

    Thanks in advance,

  • lalji Jun 10, 2013 @ 5:29

    su –

  • dhanbir Jul 18, 2013 @ 11:25

    $ sudo passwd

    new password for root and confirm. that will be root password now.

  • calvin Jul 27, 2013 @ 22:16

    Thank you mate ….you helped me alot :)

  • anas Mar 4, 2014 @ 16:26

    thankx tom :)

  • Linux User Jun 25, 2014 @ 5:26

    Thanks! This really helps :)

  • ram tomar Jul 28, 2015 @ 2:37

    hey i’m using ubuntu in vmplayer and forgot the administrator password, can you help me?

  • muhammad Asif Oct 16, 2015 @ 19:16

    ****** ?

  • pallab jyoti Mar 6, 2016 @ 10:55

    You are awesome man!!!!!!!!!

  • kashif Mar 26, 2017 @ 7:04

    HI any body can help in installing client for GUI access to godaddy cloud server. You help will be appreciated. Thank you.

  • Alexander Ewering Dec 7, 2020 @ 12:10

    Congratulations, so now Ubuntu has finally arrived where Windows was decades ago — a dumbed down system where people can’t do shit :D

  • Nuwaira Rassi Jun 12, 2021 @ 16:34

    Last bit was useful and that what I was looking for:
    sudo -i

    Now I have root password

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum