sudo --Run with administrator privileges

sudo is a function for a general user to execute a command with the authority of another user, but it is generally used to execute the command with the authority of root.

If you do not specify a user with sudo, execute the command with root user privileges.

sudo command

When you run sudo, you will be asked for your own password again. Once you enter your password,

How to use sudo

As an operation method, first create an administrator general user with useradd (kimoto etc.).

sudo useradd -m kimoto

Set a password with passwd.

sudo passwd kimoto

With gpasswd, add a regular administrator user to the sudo group.

sudo gpasswd -a kimoto sudo

Kimoto can now run commands that require root privileges with his password.

Advantages of sudo

The advantage of sudo.

  • sudo has a function to record who executed what command
  • Over time, you lose root privileges. You will be prompted to re-enter your password. It is safe even if the terminal is left unattended.
  • Root authority is also a risky authority, so if you know who worked, you can work with a sense of tension

Associated Information