Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of adding user's root right in linux system

Shulou Source: shulou.com Published: 2022-06-03 06:03:29 11月16日 Update

Method 1: modify the / etc/sudoers file, find the following line, and remove the previous comment (#)

# # Allows people in group wheel to run all commands%wheel ALL= (ALL) ALL

Then modify the user to belong to the root group (wheel), with the following command:

# usermod-g root tommy

After the modification, you can now log in with your tommy account, and then use the command su-to get root permission to operate.

Method 2: modify the / etc/sudoers file, find the following line, and add a line under root, as follows:

# # Allow root to run any commands anywhereroot ALL= (ALL) ALLtommy ALL= (ALL) ALL

After the modification, you can now log in with your tommy account, and then use the command su-to get root permission to operate.

These are the details of how to add root permissions for users in linux. For more information, please follow other related articles!

Tags: Permissions one line commands methods users files accounts logins content that is articles more comments system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker Xiaomi Redmi Linux