How to run command as administrator? [duplicate]

In terminal, I find this and it does not respond well to my orders, what should I do?

To run a command as administrator (user "root"),
use "sudo <command>".
See "man sudo_root" for details.

This message is found in the beginning of terminal.

3

1 Answer

Just use sudo <command>, where command is the order, or instruction you want to run as superuser. If you get an error like:

user is not in the sudoers file

You must edit the /etc/sudoers file. To do so, type

su

Enter the root password

Then, you can use nano or vi to edit the file, for example:

nano /etc/sudoers

Look for a line like this:

root ALL=(ALL) ALL

And add a new line bellow this, like:

myUser ALL=(ALL) ALL

Now, reboot your computer, and then try to use sudo.

Regards.

You Might Also Like