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, 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.