How to switch from a normal user to a root user under Linux

Source: Internet
Author: User

1. First, we enter the PWD command to view the current user directory:

Current user is xg which I explained [[email protected] ~]$ this meaning, where xg refers to the current user, localhost refers to the hostname, ~ refers to the current directory, the following $ symbol represents the ordinary user, the ordinary user is under the input instructions, If it is the root user, it will become this, the root user is to enter the command in the #:

2. Then we enter Su XG and Su separately-as shown in:

Enter the SU xg command, and enter the password of XG can not switch to the root user, and input Su-command, at this time we enter the password is wrong, the command line will display the information, as shown in:

At this point, enter the Su-command, enter the correct password, and then you can switch to the root user (note: Here I also dizzy, do not know the default password is what, if you do not change the root password below, should be the current user's password, if you have changed the root password. Then you need to enter the password you changed):

Note: If the default password here is not the current user password, you can go to the information, know that you can tell me, because I am in the Linux system to try too much, forget this step of the default password! If you've ever changed the root password. Then you need to enter the password of the root user you have changed!

3. Next I will enter the sudo passwd root command under root to create the root user, the situation is:

What does that mean? After entering this command, change the root user's password, ask us to enter a new UNIX password, and then re-enter the new UNIX password, if the input password is not reasonable, you can not successfully modify the root user's password.

4. Next I turn off the Linux system, turn on the Linux system, enter Root,password under Username, enter the new UNIX password we set up, and find that our user has become the root user as shown:

5, do not know I previously created xg Normal user can also log in? So I turned off the Linux system, then turned on the Linux system, entered the user name xg and xg corresponding password, found as shown:

The answer is yes, XG users can still use.

6. The above content is I search the Internet, and then constantly in their own computer to try to write out an article, some of the knowledge points I do not know how, but constantly try to have a harvest, because I am in the class are in root super user inside operation, so I will directly login root user, To accumulate knowledge of Linux learning! (I discard my xg users), because there are a lot of learning in the back to use root Superuser permissions and files and a lot of other things!

How to switch from a normal user to a root user under Linux

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.