How to switch to root in the newly installed Ubuntu method

Source: Internet
Author: User

Switching between the root and user users in Ubuntu
Ubuntu is a very popular Linux system recently, because Ubuntu does not start the root user by default, and now describes how to enter the root method.




(1) switch from user to root

Whether you're logging in to Ubuntu in graphical mode or in command-line mode, we'll find the default user

However, when we need to perform some root-permission operations (such as repairing system files), it is often necessary to use sudo authorization, which is very troublesome

At this point we can switch to the root user and simply execute sudo su

Note: For security reasons, the default Ubuntu root user does not have a fixed password, its password is randomly generated and dynamically changed

, seems to change every 5 minutes, so using SU (switch user) is not possible, because we do not know the root password



(2) User user is cut back from root

To cut back from the root user, simply execute the command: SU User (User is the username of your own installation), or enter exit directly, or you can ctrl+d the key combination



(3) Set a password for root

The default root user is not a fixed password, and is locked, if you want to set a password for root

Simply execute the command: sudo passwd root and then follow the prompts step-by-step to

This can be referred to in (1) as the SU root, enter the root password to switch to the root user

Note: After setting the password for root, sudo su can still switch to the root user

Attached: Users and groups in the graphical mode system---system management can also set a password for root



(4) Disabling and enabling root login

Execute sudo passwd-l root (just disable root, but the root password is still saved), then perform SU root discovery authentication failed,

To start root login again, execute sudo passwd-u root



(5) Allow Ubuntu to log in automatically

Graphics mode, System Management, Login window authorization to unlock after the selection

Automatically login as user.

How to switch to root in the newly installed Ubuntu method

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.