You need to log in to create posts and topics.

How to Run a Command as root user in Linux?

I'm trying to run a command in Linux, but it throws an error "Acess Denied: user access denied"

The command is,

$ usr/lib/etc/sudoers.so

Solutions Recommended!

You must need to log in as the root user to access those files. If you want to do a quick switch to root account and then follow the below instruction:

The command to switch from a normal user to root user without logging out:

 

$ sudo su

The terminal will prompt you to enter the password for the root user. Enter the password. Now you can run any command with root user privileges on Linux PC.

Switching to root user

Now you can run any command with or without "sudo" in it. The terminal will execute it. The example image added below:

Executing command as root user

Once you finished, you need to use the command to switch back to the normal user account:

exit 0

Exit sudo mode