Switch between root and common users in ubuntu

Source: Internet
Author: User
In ubuntu, switching between root and common users is a popular Linux system recently, because Ubuntu does not start root users by default. now we will introduce how to access root. (1) switching from a user to a root user is a very popular Linux system recently, whether it is to log on to Ubuntu in graphic mode or to switch between root and common users in command line mode, because Ubuntu does not start the root user by default, we will introduce how to enter the root user. (1) switching from a user to a root user, whether logging on to Ubuntu in graphic mode or logging on in command line mode, we will find that the default user is user, but when we need to perform some operations with root permissions (such as repairing and returning system files), we often need to use sudo authorization, in this case, we can switch to the root user and simply execute sudo su. Note: For security reasons, the root user of Ubuntu does not have a fixed password by default, its password is randomly generated and dynamically changed. it seems to be changed every 5 minutes, so su (switch user) is not allowed, because we do not know the root password (2) switch from the root user back to the user. to switch from the root user back to the user, you only need to execute the command: su user (user is the user name you installed), or directly enter exit, you can also press Ctrl + D to launch (3) set a password for the root user. by default, the root user does not have a fixed password and is locked. if you want to set a password for the root user You only need to execute the command: sudo passwd root and then follow the prompts to step by step so that you can switch to the su root as mentioned in (1). note: after setting a password for the root user, you can still switch sudo su to the root user. Attached: in graphic mode, system management> users and groups can also set a password for the root user (4) disable and enable root logon. execute sudo passwd-l root (only root is disabled, but the root password is still saved). then execute su root to find that authentication fails and start root login again, run sudo passwd-u root (5) to enable Ubuntu to automatically log on to the system in graphic mode-> System Management-> Authorize and unlock the logon window and select automatic logon as user.
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.