Ubuntu Linux root password - default password
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:
- What is my root password for MySQL?
- Default username created during a new installation of Linux?
- What is My root Password for MySQL Database Server?
- Change MySQL root password
- MySQL Change root Password
Discussion on This FAQ
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!
Tags: administrative commands, default account, Linux, Networking, root account, root password, root shell, root user



September 28th, 2006 at 12:34 pm
I have also found “sudo bash” useful as an alternative to “su”.
October 14th, 2006 at 2:35 am
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
October 14th, 2006 at 10:52 am
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.
December 30th, 2006 at 6:49 pm
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
August 4th, 2007 at 2:57 pm
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
December 17th, 2007 at 12:05 am
“sudo su” will also work.
December 20th, 2007 at 11:43 am
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
February 25th, 2008 at 8:45 am
well i have a problem…i can’t use sudo command with my user (id 1000), it starts shouting that you need poweruser rights…
April 8th, 2008 at 9:16 am
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.
April 11th, 2008 at 5:49 pm
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
April 11th, 2008 at 6:39 pm
Bob,
su command is outdated. You need to type the following command to become root user (enter your own account password):
sudo -ior
sudo bashHTH
June 30th, 2008 (2 weeks ago) at 3:24 pm
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.
July 4th, 2008 (5 days ago) at 3:13 am
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.