If you are an advanced user who needs access to an actual root shell to run specific scripts, simulate a root shell with sudo –i. This command will give you superuser access with root’s environment variables.
Enter the command sudo passwd root. This will create a password for root, essentially “enabling” the account. Don’t forget this password.
Type sudo -i. Enter the root password when prompted.
The prompt will change from $ to #, indicating you have root access.