How can I permanently grant root access to a user?

To give the user "foo" unlimited passwordless access to root privileges via the sudo command, edit /etc/sudoers and add the line:

foo   ALL = NOPASSWD: ALL

See sudo(8) and sudoers(5) for more information.

As was suggested elsewhere, if you know how to use vi then it's a good idea to use visudo to edit /etc/sudoers.


It is not you who is being restricted (as long as you can sudo or login as root on the command-line), but it is rather every single application you run that is being restricted.

If you give yourself root privileges, every application you run also gains complete power over your computer. That is the restriction, and saying you don't want any restrictions placed over you is like saying you do not want to lock your bike or your door, for it places a restriction upon yourself.

I am amazed no one as of yet has tried to offer you that insight.


Being a noob, you should better use visudo instead of editting /etc/sudoers on your own, at least because:

  1. It checks that no one is using the /etc/sudoers file at the same time.
  2. When you have finished, it checks the file for making sure it's fine.

Tags:

Sudo

Root