Ubuntu login Root User

Source: Internet
Author: User

Unlike other versions of Linux, Ubuntu Linux has a distinctive feature, that is, when you use it for the first time, you cannot log on to the system as the root user. Why? This should begin with the installation of the system. For other Linux systems, the root password is usually set during the installation process, so that the user can use it to log on to the root account or use the su command to convert to the Super User identity. In contrast, UBUNTU does not set a password for the root user or enable the root account when it is installed by default. The problem is, what should I do if I want to run the command as a root user? It doesn't matter. We can use the sudo command for this purpose. Sudo is a common tool in Linux that allows common users to use superuser permissions. This command provides the Administrator with a fine-grained access control method, through it, people can access the system both as Super Users and as other types of users. The advantage of this is that administrators can grant some specific types of Super User Permissions without telling the user the root password, which is what many system administrators dream.

It is necessary to briefly describe the difference between the sudo and Su commands:
The su command is a tool for switching users without exiting the current user. Su can be used to switch between users. If the super-Permission User Root switches to a common or virtual user, no password is required, the password verification is required for normal users to switch to other users.
Sudo is a very useful tool on Unix/Linux platforms. It allows system administrators to assign reasonable "rights" to common users ", this not only reduces the login times and management time of root users, but also improves system security. Sudo designers aim to give users as few permissions as possible but still allow them to complete their work.
We can simply understand that: su obtains stable super users (or other user permissions), and sudo temporarily limits the Super User Permissions, which will expire after a period of time.

Okay. The specific setting method is as follows:
Method 1:
1. Set a root password for root: $ sudo passwd Root
Then, the system will prompt you to enter the root user's password and enter the root password continuously.
2. Use: $ su and enter the root password as prompted to switch to the super administrator user in the terminal!

Method 2: (this is another method on the Internet. I tried it. It seems that I can remove Step 2)
1. Reset the root password: $ sudo passwd root # Enter the new password twice as prompted and confirm it.
2. enable the root user logon: $ sudo VI/etc/TPD. conf; open the gnome configuration file, enter: allowroot in the last line mode, press enter, find allowroot = false, change false to true, save and exit. (If you are not familiar with Vi, you can select other text editors installed on your own, such as vim or gedit. I am using gedit, command: $ sudo gedit/etc/TPD. conf), you can log on to the system as the root user.

Other considerations:
1. after performing the preceding settings, you can only log on to or switch from the terminal, when you log on to the Ubuntu login interface as a root user, the system prompts "cannot log on to the system administrator from this screen" appear. If you want to log on from the login interface, you need to perform the following steps: choose system> System Management> login window and switch to the security option page, then, select "Allow local system administrator login" (allow local system administrator to log on. Of course, login to the root user from the login interface is not promoted!
2. Sudo passwd root is used to set the password of the root user to enable the root account. The account to be locked is sudo passwd-l, and the account to be opened is sudo passwd-U (it must be locked before, otherwise it is invalid ).

 

[To] http://www.linuxdiyf.com/viewarticle.php? Id = 160965

  

  

In addition:

The root user of Ubuntu is not activated by default. You need to manually activate it.
The activation method is to set a password for the root user with the root permission.
Manually enter "root" as the user name during login, and then enter the corresponding password.

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.