Linux sudo su Japanese su classification

This article is a study note, video address: https://www.bilibili.com/video/av62836363

su is to apply to switch the root user, you need to apply for the root user password. Some Linux distributions, such as ubuntu, do not set the root user password by default, so we need to sudo passwd rootset the root user password first .

And sudo su is the current user temporarily applying for root privileges, so the input is not the root user password, but the current user's password. Sudo is a user applying for administrator privileges to perform an operation, and the operation here is to become an administrator.

expand:

Source: https://baike.baidu.com/item/sudo/7337623

Sudo is a Linux system management command, a tool that allows system administrators to allow ordinary users to execute some or all root commands, such as halt, reboot, su, etc. This not only reduces root user login and management time, but also improves security. Sudo is not a substitute for the shell, it is for every command.

Its characteristics are mainly as follows:

§ sudo can restrict users to only run certain commands on a certain host .

§ sudo provides a rich log that records in detail what each user did. It can transmit logs to a central host or log server.

§ sudo uses timestamp files to implement a similar "ticket checking" system. When the user invokes sudo and enters its password, the user gets a ticket with a lifetime of 5 minutes (this value can be changed during compilation). After a period of time (default is 5 minutes, can be customized in /etc/sudoers), using sudo does not need to enter the password again.

§ The sudo configuration file is the sudoers file, which allows the system administrator to centrally manage the user's usage rights and the host used. It is stored in /etc/sudoers by default, and the attribute must be 0440.


Before sudo was written around 1980, the general user management system was to use su to switch to a super user. But one of the disadvantages of using su is that you must first inform the super user's password

Since the password of the super user is not required, some Unix-like systems even use sudo to make the general user replace the super user as the management account, such as Ubuntu , [Mac OS X]( https://baike.baidu.com/item/Mac  OS X) Wait.

Guess you like

Origin blog.csdn.net/londa/article/details/108584156