Granting root access to other users on WHM Ubuntu

The top level user in any Linux based OS is the root. However, it is advised to disable the root account as a security measure. The hacker always tries to use Brute Force attacks on the root user account. Disabling this account will prevent any attacks on the root. At the same time, we can have other account with the root privileges. In this article, we shall learn about the process to provide root privileges to other user account on Ubuntu.

Granting Root Access to other user account

  • Login to the Ubuntu Server using WinSCP SSH information
  • Navigate to the path /etc
  • Look for the file named sudoers
  • Right-click on the file and press Edit. Search for the below block in the file:
				
					#User privilege specification
root     ALL=(ALL:ALL) ALL
yourUsername ALL=(ALL:ALL) ALL
				
			
  • Replace yourUsername with your actual username in Ubuntu for which you want to provide root access
  • Save the file and then close it

Testing root privileges for the account

  • Login to your Ubuntu Server using Putty with your SSH credentials of the new username for which you recently applied root privileges to
  • Then inside the shell, type the following:
				
					$ sudo su
				
			

It will then prompt you to enter password for your account again. Enter your password and you have got root access !
To confirm the same, type the below command in the shell:

				
					$ sudo whoami
				
			
				
					Output
root