By default, Ubuntu does not allow users to log on to the Ubuntu system as root. you can find the following methods on the Internet: 1. first
Use root to log on to Ubuntu
By default, users are not allowed to log on as root in Ubuntu. you can find the following methods on the Internet:
1. first set the root password, use the existing administrator account to log on to Ubuntu, execute the command: sudo passwd root on the terminal, then enter the password and root password, and repeat the password. In this way, a root user is available.
2. by default, you are not allowed to directly log on to the GUI using the root account. You can modify the vi/etc/lightdm. conf file to allow the root user to log on directly,
AddGreeter-show-manual-login = true allow-guest = false.The entire modified configuration file is
[SeatDefaults]
Greeter-session = unity-greeter
User-session = ubuntu
Greeter-show-manual-login = true # manually enter the user name and password for logging on to the system
Allow-guest = false # logon from guest is not allowed
Restart ubuntu. The "login" option will be available in the logon window. at this time, we can log on through the root account.
If the above method still cannot be solved, perform the following operations:
Modify the/etc/pam. d/login file:
Gedit/etc/pam. d/login
Find
Auth [success = OK new_authtok_reqd = OK ignore = ignore user_unknown = bad default = die] pam_securetty.so
Modify it to the following content:
Auth requisite pam_securetty.so
After completing the above operations, restart the computer. Now, the root user can log on to the computer.