user-name is not in sudoer file and su authentication failure

when using sudo command, I met the error: "uers-name is not in the sudoers file, and this incident will be reported". And then I tried some answers in the internet, such as "su root " and so on and then I got the error"su:authentication failure". I knew there were many questions and answers about "not in the sudoers file" and "su:authentication failure" respectivley, but discussions are often like this:

  1. as for "not in the sudoers file", the answer referred to "su root"
  2. as for "su:authentication failure",the answer referred to"sudo" however, I met first "not in the sudoers file", and then follow instructions "su root" or "su -i",and I got error"authentication failure" , then some answers says to some"sudo" command to solve the "authentication failure". I couldn't use the "sudo" command, how could I use this to solve the "authentication failure" problem? Doesn't this mean a snake want to chase its tail? So far, I didn't see any answer that can explain explicitly about this problem and really have been stuck in it some time. Could anyone please give me clues on this?

  • When attempting to use sudo, an error users-name is not in the sudoers file indicates that your account is not authorized to use the sudo command to elevate to root privileges.
  • When you attempt su root, or just su, it will not work on a default Ubuntu install. On Ubuntu, the root account is not enabled by default. That means you cannot log in to that account. Henceforth, you also cannot use su to switch to that account. A system administrator will instead use sudo to launch processes with root privileges on behalf of his own account, that has been granted permission to use sudo.

Resolution: ask your system administrator to add your account to the sudo group.