Linux enters and exits root administrator privileges

overview

In Linux systems, entering and exiting root administrator privileges is an important process for system management and performing sensitive operations. By using the su - root and su - username commands, we can switch to the root user or other ordinary users in the terminal to obtain the corresponding permissions. The use of these two commands will be introduced in detail below.

Enter root privileges

1. Open the terminal: First, open the terminal application;


Insert image description here

2. Enter the command: In the terminal, enter the following command and press Enter to switch to root permissions;


su - root

Insert image description here

3. Enter the password: At the prompt, enter the password of the root user and press the Enter key.
请注意,在输入密码时,终端不会显示任何字符,这是出于安全考虑;


Insert image description here
Verify identity: If the password entered is correct, the system will verify your identity and switch you to the root user. At this point, you will have full system administrator rights and can perform operations that require root privileges.

Enter user permissions

In addition to the root user, you can also use the su - username command to switch to the permissions of other ordinary users. Here are the steps to access other user permissions

1. Enter the command: In the terminal, enter the following command to switch to other users;
请注意,用户名是自己本机电脑的用户名;


su - 用户名

Insert image description here

summary

In summary, by using the su - root command, we can enter root administrator privileges and gain full system management rights. Using the su -username command, we can switch to the permissions of other users. After completing privileged operations, please exit in time to protect the security of the system. Please use root privileges with caution and always follow best practices to keep your system secure.

Guess you like

Origin blog.csdn.net/huzhuohuan/article/details/131679235