How to enable the root user and change the password in Ubuntu

Source: Internet
Author: User
Tags time limit

1. Enable the root account

The command to enable the root user is as follows:

The code is as follows: Copy code

Sudo passwd root

Follow the output prompt to enter a new password and confirm it. (if you have set a password before, enter the previous password. Otherwise, you cannot change the password ). After you restart Ubuntu or log out of the current user, you can log on with the root user (the root name is case sensitive !!!).

If you only want to switch to the root account in terminal mode (for temporary use), you can use:

The temporary switch command is as follows:

The code is as follows: Copy code

Sudo-s-H

Enter the root password as prompted.

Note: Other platforms may use su root and su-root (if the current logon account is root and you want to switch to another xxx user, you only need to execute su xxx without entering the password ). The password is saved for 15 minutes by default. If it exceeds the time limit, you may need to enter the password again.

II. Close the root account
The command to disable the root account logon is as follows:

The code is as follows: Copy code

Sudo passwd-l root

3. Resetting the root password

The command is the same as the command for enabling the root password:

The code is as follows: Copy code

Sudo passwd root

If you are using Ubuntu 12 or a later version, the ROOT account will not be able to see the logon portal. Next I will introduce the solution.

The code is as follows: Copy code


1) test @ ubuntu :~ $ Sudo su-

2) root @ ubuntu :~ # Cp-p/etc/lightdm. conf/etc/lightdm. conf. orig

3) root @ ubuntu :~ # Vi/etc/lightdm. conf

4) add the following parts:

The code is as follows: Copy code

Greeter-show-manual-login = true

5) after the modification is completed, it looks like the following:

The code is as follows: Copy code

[SeatDefaults]

Greeter-session = unity-greeter
User-session = ubuntu
Greeter-show-manual-login = true

6) save and exit: wq

7) restart Ubuntu 12.04 LTS and you will see the Login (Other) logon option.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.