Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save codedeep79/6d2819710a49c2ad7bd8df63050c7f15 to your computer and use it in GitHub Desktop.

Select an option

Save codedeep79/6d2819710a49c2ad7bd8df63050c7f15 to your computer and use it in GitHub Desktop.
Error: debian is not in the sudoers file. This incident will be reported.

This article explains how to "fix" sudo not working on Linux, resulting in this message when trying to use it: "your-username is not in the sudoers file. This incident will be reported." on Debian (and Debian-based Linux distributions like Ubuntu). The solution 1 here is:

su -
usermod -aG sudo YOUR_USERNAME
exit

The solution 2 here is:

  • First, switch user to root using the su command. Type your root password when prompted: su
  • Edit the sudoers file using the vi editor or any other editor you are comfortable with: visudo
  • Scroll down until you find root ALL=(ALL) ALL and add the following line below it. Replace with your actual user name.
    <your username> ALL=(ALL) ALL
    
  • Log out and back in (or reboot) the system for the change to take effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment