How to switch the newly installed Ubuntu to the root
Source: Internet
Author: User
In Ubuntu, switching between root users and user users is a popular Linux system recently, because Ubuntu does not start root users by default. now we will introduce how to enter the root user. (1) switch from the user to the root user, whether logging on to Ubuntu in graphic mode, or the command...
Switching between root and user users in Ubuntu
Ubuntu is a popular Linux system recently. Because Ubuntu does not start the root user by default, we will introduce how to enter the root user.
(1) switch from user to root user
Whether logging on to Ubuntu in graphical mode or logging on in command line mode, we will find that the default user is user
However, when we need to perform operations with root permissions (such as repairing and returning system files), we often need to use sudo authorization, which is very troublesome.
Now we can switch to the root user, just execute sudo su.
Note: For security reasons, by default, the root user of Ubuntu does not have a fixed password. the password is randomly generated and dynamically changed.
Is changed every five minutes, so su (switch user) is not allowed, because we do not know the root password.
(2) 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
(3) set a password for the root user.
By default, the root user has no 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 one step at a time.
In this way, you can enter the root password to switch to the root user as mentioned in (1 ).
Note: After setting the password for the root user, you can still switch sudo su to the root user.
Appendix: in graphic mode, choose System> System Management> Users and Groups. you can also set a password for the root user.
(4) disable and enable root logon
Run the sudo passwd-l root command (only root is disabled, but the root password is still saved), and then run the su root command to find that the authentication fails,
Start the root login again and run sudo passwd-u root.
(5) enable Ubuntu to log on automatically
In graphic mode, choose System> System Management> logon window, authorize and unlock, and select
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.