This question already has an answer here:
- What is the default root password? 4 answers
On a standard desktop installation, I created my administrative and user login.Further with some applications, the system ask for the root password.
So my question is: What will be the default password for the root login when I never created it during the installation process?
Radu Rădeanu
124k35 gold badges257 silver badges330 bronze badges
hbbhbb
What Is The Default Root Password For Linux
marked as duplicate by Jorge Castro, user117103, Eric Carvalho, Warren Hill, BuZZ-dEEMar 27 '14 at 18:10
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3 Answers
By default root does not have a password and the root account is locked until you give it a password.
When you installed Ubuntu you were asked to create a user with a password. If you gave this user a password as requested then this is the password you need. If not, or you have forgotten it, then you need to set a password.
Instructions on how to do it are here:How do I reset a lost administrative password?
Once you have an administration password you can use
sudo
to run commands that would otherwise require you to be root and enter your password.
If you want to set a root password see this questionHow to enable root login?
However, read all the answers carefully first to make sure you want to do this. It's not recommended and many of the answers explain why.
Community♦
Warren HillWarren Hill
16.6k16 gold badges54 silver badges78 bronze badges
What Is The Default Root Password Redhat Linux
Open terminal and type following command:
then press enter button. Type in your new 'root password', like '123456' and verify the new password, by entering it again, followed by the enter button.
Now your new 'root password' is set to '123456'.
v2r
6,61811 gold badges41 silver badges49 bronze badges
Hemanth ReddyHemanth Reddy
Are you sure that the system is asking for the root password?. It usually asks for your password to request elevation.
Javier RiveraJavier Rivera
30.5k9 gold badges80 silver badges104 bronze badges
Not the answer you're looking for? Browse other questions tagged passwordroot or ask your own question.
On every Linux system, the root account is a special user that has administrative rights. Logging in as root (or executingcommands with root privileges) is necessary for many tasks. If you need to perform tasks as the root user, make sure that you fully understand the commands you are running, and what consequences they have. A single careless or malformed command, run as root, can make the entire operating system unusable. Do your research, and always double-check every command before pressing Enter.
Logging in as root
The root account is similar to any other account in that it has a username ('root') and a password. If you know root's password, you can use it to log into the root account from the command line.
There is a special command named su (for 'super user,' or 'switch user'), that allows you to temporarily run commands as the root account. From the command line, type:
Enter the password once prompted for the password. If successful, you are switched to the root user, and can run commands with full system privileges.
Be careful while logged in as root; it is easy to forget that you are currently the root user, and you might inadvertently run a command thinking you are only a mere mortal. One way to remind yourself if you are root or not is to check your command prompt. Many systems end their command prompt with a dollar sign ('$') if you are logged in as a normal user, but with a pound sign ('#') if you are root.
Or, you can use the whoami command to determine the account you are using.
When finished with your administrative tasks, you can run the exit or logout command to return to your standard user account.
When logging in as root, it is often useful to use a single dash after the su command, like this:
This command simulates a complete root login. It executes all of the root user's shell initialization scripts and sets all environment variables as if the root user were logged into a fresh shell session. Depending on what task you need to perform, and how the root account is configured, this form of the su command might be optimal for you.
Running commands as root without the root password
It is possible, and often preferable, to run commands as root without logging into the root account by using the sudo command, which stands for 'superuser do'. If you prefix a command with sudo, you are prompted for your password (not the root password), and your name is checked against a special file called sudoers. If your account is listed there, your command will be run with root privileges.
Using sudo makes it much more difficult to forget that you are root since you are not logged into the root account, and are never going to forget to log out. Also, typing sudo every time you run a potentially destructive command reminds you to be extra careful and double check yourself.
If you need to add a user to the sudoers list, you should use the visudo command that requires root privileges to run, and allow you to safely edit the sensitive sudoers file. Mass effect 3 anderson death.