Switching between the root and user users in Ubuntu

Source: Internet
Author: User

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.

Note: My Ubuntu is 14.10 version to view the Ubuntu version of the command is:

Execute the following commands in the terminal:

Cat/etc/issue

You can view the version number of the Ubuntu that is currently running. The output is similar to the following:

Ubuntu 14.04 \ \l

Switching between the root and user users in Ubuntu

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.