Method One: Change the/etc/sudoers file,
Find the following line and remove the previous gaze (#)
# # allows people in group wheel to run all commands
%wheel all= (All) all
Then change the user to belong to the root group (wheel),
Commands such as the following:
#usermod-G Root Devuser
After the change is complete, you can now log in with your Tommy account and then use the command su–. You can get root permission to operate.
Method Two: Change the/etc/sudoers file.
Locate the following line. Add a row below root,
For example, see the following:
# allow ROOT to run any commands anywhere
Root all= (All) all
Devuser all= (All) all
Changes completed, can now log in with Devuser account, and then use the command sudo–, you can get root permissions to operate.
Method Three: Change the/etc/passwd file.
Find for example the following line. Change the user ID to 0,
For example, see the following:
Devuser:x:0:33:devuser:/data/webroot:/bin/bash
Changes in Centos root permissions