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.