Ubuntu has a distinctive feature, that is, when you first use, you cannot log in as root to the system, why this? This will start with the installation of the system. For other Linux systems, the root password is typically set during the installation process so that users can log on to the root account or use the SU command to switch to Superuser status. By contrast, Ubuntu does not set a password for the root user and does not have the root account enabled when it is installed by default. The question is, what if you want to run the command as root? It doesn't matter, we can use the sudo command to achieve this.
sudo is a tool commonly used under Linux that allows ordinary users to use superuser privileges, which gives administrators a granular access control method through which people can access the system as both Superuser and other types of users. The advantage of this is that administrators can grant certain types of superuser privileges without telling the user the root password, which is what many system administrators are dreaming of.
Setting the allocation is simple, just set a root password for root: $ sudo passwd root
You will then be prompted to enter the root user's password, enter the root password consecutively, and then use: $ su
You can switch to Super Admin user login!
A
In fact, I personally think this is not much necessary, because when you need root permissions, use sudo can be. If you really need to enable the root account in Ubuntu, then you might want to do the following:
1. Reset the root password:
$sudo passwd Root #按照提示输入两次新的密码 and confirm it.
2. Enable Root User login:
$sudo vi/etc/x11/gdm/gdm.conf #打开gnome的配置文件, enter in the last line mode: Allowroot Enter, find Allowroot=false, change false to True, save and exit.
Then, when you restart the system, you can log in with root. If you want to disable the root account, execute the following command:
$sudo passwd-l Root
Two
The root account in Ubuntu is disabled by default. In this case, if you want to use root permissions to do something, you will need sudo instructions. For some friends, they may need to activate the root account in Ubuntu.
The process for activating the root account in Ubuntu is as follows:
1. After the terminal executes the sudo passwd root command, you will be prompted to set a new root account password.
2. Click the Login Window menu, System-Preferences, and switch to the Security Options page and select the Allow local System Administrator Login option under it.
After performing these two steps, you can log in to the Ubuntu system using the root account.
If you want to disable the root account again, you can execute sudo passwd-l root.
Three
If you always want to use root can also "sudo-s".
Linux Learning Note (3): Ubuntu uses super Admin root login