Setting up sudo

Some people say sudo is a cheat. However, it allows the user to run commands as root from his or her account. To allow this, the user has to be put into the sudoers file.

How to change the sudoers file:

  1. Run the sudo editor, visudo.
  2. Press "i" to enter insert mode in order to edit the file.
  3. Once the changes have been made, hit ESC to exit.
  4. To save the file, type :w.
  5. To quit the editor and save the changes, type :q.
  6. To quit without saving the changes, type :q!.

To allow the user access:

  1. Uncomment the line with User_Alias.
  2. Add the username (i.e. User_Alias = petey)
  3. Add the following line ADMINS ALL=(ALL) ALL under root ALL=(ALL) ALL if it does not exist.