LAMP using Username but says not in sudoer file (SOLVED)

I have created <username> to log in alternatively in LAMP appliance. However, as I try logging in as root typing sudo su - I receive this error message:

<username> is not in the sudoers file. This incident will be reported.



Thank you.



Guest's picture

Hi, you need to log in as the root or sudo account, in the shell, type:

visudo (for root account)


sudo visudo (for sudo account)

and then add yourself a line below:

# User privilege specification
root    ALL=(ALL) ALL
<username>    ALL=(ALL) ALL

(you need to type i to insert characters, and when you are done, press Escape, and then :wq to save & quit.


 Good luck!


# /etc/sudoers
# This file MUST be edited with the 'visudo' command as root.
# See the man page for details on how to write a sudoers file.

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
  <username> ALL=(ALL) ALL



Hi look, the above is the visudo file I have added <username> ALL =(ALL) ALL


still sudo su doesn't work for my new user, any explanation?


Thank you.

Guest's picture

Hi, by <username> I mean input there the name of the user you want to be sudo, not <username> itself.

for example:

root    ALL=(ALL) ALL
leow    ALL=(ALL) ALL

Of course this user account must have been created before on your system.

Let me know how you get on.

I meant <username> = leow

I understand that part, friend. It didn't work.

Thanks, Guest. It's working, I just apt-get update it and re-do. It's working now.


Thanks a bunch.



Guest's picture

Glad I helped. I think you need to log out and log back in again for the change to take effect.

Anyway you're sorted now.


Guest's picture

manjot@Matrix:~$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied
 hi, i get this output when type -  visudo


and when i used it as sudo

manjot@Matrix:~$ sudo visudo
[sudo] password for manjot:
Sorry, try again.
[sudo] password for manjot:
manjot is not in the sudoers file.  This incident will be reported.

how can i be a sudoer user? and get root password?

1. Log in as Root.

2. type visudo

3. add this

root    ALL=(ALL) ALL
manjot    ALL=(ALL) ALL

4. Save

* Learn how to edit visudo. You need to type 'i' before you're able to edit. After that, 'Esc' and :wq to save and quit.

* Refer to the upper posts, I'm also taught. Unfortunately I don't know his name. He's 'Guest'


Clement's picture

Hey leow, you made me think I should create an account :-) so my name is not "Guest" :-)

manjot - did you manage to sort out your problem? make sure you input what leow wrote under

# User privilege specification
root    ALL=(ALL) ALL

before you save & quit. the whole procedure is described above in the post. Naturally you'll need to have control of an administrative account such as root.

Post new comment