How do I set/change/enable the password of the root user?
● Sudo passwd root
To enable the root account (that is, set a password:
Sudo passwd root
After you use it, block the root account from using it:
Sudo passwd-l root
This will lock the root account.
In terminal mode, how does one switch to the root identity?
● Udo-s-H
Password: <enter your Password here>
The benefits of disabling root by default include.
● The Ubuntu team wanted to install Ubuntu as simple as possible. Without root, the two user interaction steps during the installation can be omitted. (Colin Watson)
● Further, if root is used during installation, users will be asked to always remember their selected password-even if they seldom use it. the Root password is often forgotten by users unfamiliar with the Unix security model. (Matt zimuman)
● This prevents "I can do anything" during the default logon. Before a major change occurs, you will be prompted to enter a password, which allows you to consider your results. if you log on as the root user, you can delete some "useless Folders" without realizing that you are in the wrong directory. It was too late. it is a Unix practice that uses "su-command-^ D" for a long time, instead of staying in the root shell-unless you do serious system maintenance (then you can still use "sudo su "). (Jim qita and Andrew sobara)
● Udo adds the log records for running commands (in/var/log/auth. log ). if you are in trouble, you can always return and see the running commands. (Andrew zbikoski)
Security
Compared with the traditional superuser model, this method has different advantages and disadvantages. Both of them do not always show good results.
● We encourage you to use the root permission to execute a separate command. sudo is better than opening a shell:
● It takes less time to use the root permission, reducing the risk of not paying attention to using the root to execute commands
● Useful review traces
● An individual root Password (traditional model) provides an additional layer of protection when an administrator's password is compromised.
● On how to obtain the root user through an indirect attack if the administrator (using sudo or su to become root) is attacked