How to let newly created ordinary users have ROOT permissions in Linux

  1. Log in to the system as root user.

  2. Execute the following command to edit the sudoers file:

    visudo

    Note: Be sure visudoto edit the sudoers file using the command rather than editing the file directly.

  3. In the opened sudoers file, find the section starting with "# User privilege specification".

  4. At the end of the section add a line similar to <username> ALL=(ALL) ALLwhere <username>is the username you want to add.

    For example, if you want to add user "going" to the sudoers file, the line might read:

    going ALL=(ALL) ALL
  5. Save and exit the file.

After adding a user to the sudoers file, the user will have permission to execute sudo commands.

Please note that you must be careful when modifying the sudoers file to ensure that only necessary users are assigned sudo privileges and follow security best practices. Verify the user's identity and permissions and avoid adding unnecessary rules in the sudoers file.

Guess you like

Origin blog.csdn.net/Attitude_do_it/article/details/131532173