A "sudo" user is a user that has extra privileges. It can have just some extra privileges or full root access. However, the most common use for a sudo user on a cPanel server is to create an administrative user that can gain root access on the server. Creating a sudo user with root privileges needs to be done, for instance, if you wish to disable direct root logins. (Find out how to disable direct root logins in this article.)
1. Create a user.
The easiest way to create a user is to create an additional cPanel user. If you choose this method, it will count towards your total cPanel users for licensing purposes, so you cannot use this method on a cPanel Solo server. You can also create a system (Linux) user with the adduser command.
2. Add the user to the wheel group.
Once you have a username, you can go to WHM » Manage wheel group users and move the user you've just created into the wheel group. This step allows the user access to the sudo command.
3. Test access.
Ensure that the user you created can log in via ssh and use the command
sudo su with their password to gain root privileges. You can tell that the user has root privileges if the command
whoami returns "root".
The sudoers file: /etc/sudoers
This file determines what commands different users and groups may use.
If your wheel user can not use sudo to gain root access, make sure that this line exists in /etc/sudoers
%wheel ALL=(ALL) ALL
You should not edit the /etc/sudoers file directly but use the command
visudo to make changes. This command is documented in many places, including here.