Howto create SUDO user in cPanel

For security purpose you might want to disable direct SSH login as root.To alleviate the risk, we can create a new user, who has less privileges, but is more appropriately suited to everyday tasks.When you need the power of an administrative user, you can access that functionality through a command called Sudo.First of all login as root and create an user:

useradd sshadmin
passwd sshadmin

Now add this user to wheel group from WHM

WHM -> Security Center -> Manage Wheel Group Users

OR from command line:

usermod -G wheel sshadmin

Now open /etc/ssh/sshd_config and set 

PermitRootLogin no

Restart the ssh service:

/etc/init.d/sshd restart

Now you can ssh to server as user sshadmin and run the command “su -” to switch to root user.
Now the thing is that “su -” asks for root password. If you don’t want to remember the root password then you can add the user sshadmin to sudo user list. Add below lines to /etc/sudoers

sshadmin ALL=(ALL) ALL

Now run the command “sudo su -” and it will directly switch to user root without asking password.