Root and user users in Ubuntu

Source: Internet
Author: User
Switch from the user to the root user. in the unununtu system, the default user is the user. for security reasons, by default, the root user of Ubuntu switches from the user to the root user.

In the ununtu system, the default user is user. for security reasons, the root user of Ubuntu does not have a fixed password by default. the password is randomly generated and dynamically changed. However, sometimes our users need to execute some commands that have root permissions and often need sudo authorization. Now we can switch to the root user, just execute sudo su.

Note: this user must have sudo command execution permissions, articles about sudo permissions. Refer to how to grant sudo permissions to common users in ubuntu in this blog

Switch from root user to user

To switch the user from the root user back to the user, you only need to execute the command: su user (user is the user name when you install the user), or directly enter exit, you can also press Ctrl + D to launch

Set a password for the root user. by default, the root user does not have a fixed password and is locked. to set a password for the root user, run the following command: sudo passwd root can then follow the prompts to step by step so that you can su root, enter the root password to switch to the root user Note: After setting the password for the root user, you can still switch sudo su to the root user to disable and enable root login and execute sudo passwd-l root (only root is disabled, but the root password is still saved), and then execute su root to find that authentication fails, start the root login again and run sudo passwd-u root.
Related Article

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.