The method of adding user's root right in linux system
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!