Switching between root users and ordinary users under Linux--Ubuntu

1. When performing certain operations requiring higher authority, you can use (sudo + original command) to achieve higher authority operations, but the first time you use it, you will be asked to enter a password every time you use it, which is troublesome

2. Change the root password to avoid the problem in 1..

  • Use sudo passwd in terminal to change password

 

 

  • Use the (su root) command to switch to the root user. (When the password is not changed for the first time, the su root command will prompt Authentication Failed. At this time, you need to perform the above operation of changing the root user password first)

 

  • Exit root user

At this time, even if you use (sudo + original command), you will not be asked to enter the root password every time you execute the command

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324971572&siteId=291194637