Method 1: Modify the/etc/sudoers file,
Find the following line and remove the comment (#).
# Allows people in group wheel to run all commands
% Wheel all = (all) All
Then modify the user and make it belong to the root group (wheel ),
The command is as follows:
# Usermod-g root devuser
After modification, you can log on to the system using the Tommy account and run the Su-command to obtain the root permission.
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 anywhere
Root all = (all) All
Devuser all = (all) All
After the modification is completed, you can log on with the devuser account and run the Sudo-command to obtain the root permission for the operation.
Method 3: Modify the/etc/passwd file,
Find the following lineChange the user ID to 0,
As follows:
Devuser: X: 0: 33: devuser:/data/webroot:/bin/bash