7

I just installed ubuntu desktop 13.04

I need the root access and need to know the root password During installation, I left it blank.

How can find out my root password ?

Thanks. somner

nick
  • 71
  • 1
  • 1
  • 2

3 Answers3

10

Simple answer : You can't find the root password, If you could it would break the security model.

Also, by default root does not have a password which prevents you from logging in as root.

If you want to enable root login see this post. How to enable root login? However its not recommended see here

If you have lost the password of all Administrative users see this post on how to fix: How do I reset a lost administrative password?

Another option is sudo -i with your password which runs a session as root

Also take a look here RootSudo

Warren Hill
  • 22,112
  • 28
  • 68
  • 88
2

Root login is disabled by default in ubuntu. You can switch to root with

sudo bash

and then give it your personal password.

A J Rossington
  • 218
  • 2
  • 8
  • -1, this is a bad practice. What if the user uses a different shell? Or, what if root uses a different shell than the user? It's neither uncommon nor a bad idea. sudo su, as mentioned by @StackExchange User, or sudo -s are much better alternatives. (thank you for coming to my ted talk). – Bobbbay Mar 29 '21 at 01:30
  • 1
    sudo bash gives you a new shell and therefore a new command history - keeping my normal work separate from those run as "root". If the user had enabled the root account AND changed the shell being used by root then it's unlikely they would be asking this question. As is often the case, mileage may vary but sudo bash would provide root access as well as allowing the user to enable and set a password for the real root user. – A J Rossington Mar 30 '21 at 11:53
  • Fair enough. You provide some good points, so to each their own! – Bobbbay Mar 31 '21 at 23:26
2

While the answer given by A J is technically correct, you should use sudo su to switch to the root user. If for some reason you must use his answer, please do sudo bash --login