how can i be icluded in "sodoers file"

Asked by leon antoniadis

I clean installed 16.04 but when trying to use in terminal "sudo apt"or "sudo apt-get" to install or update/upgrade I receive an
answer "leon1604 is not in the sudoers file. This incident will be reported."
Please advise

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
leon antoniadis
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You need to get your user added to the sudo group. You will need an administrator to do this for you (already with sudo access). The first account you made has this by default

Revision history for this message
leon antoniadis (leon-antoniadis) said :
#2

The problem was solved as follows:
Changed the root password
Invoked "su"
entered the new password which was accepted
Invoked visudo
Added my user name under "allow members of group sudo to execute any command
Exited
And finally" Groups" showed me in the sudoers group

For some reason during the installation I was not included in sudoers

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

What you did was not the recommended way, but it will work.
The standard method is adding a user to the sudo group (or eventually to the admin group).
command (to be executed as root or other admin user):
sudo usermod -aG sudo <username>
or
sudo adduser <username> sudo

Doing it this way does not require modifying the sudoers file.

Revision history for this message
leon antoniadis (leon-antoniadis) said :
#4

I am  the administrator as I did a clean installation therefore I could not find an administrator. For some peculiar reason my name was not included in sudoers during installation.

      From: Manfred Hampl <email address hidden>
 To: <email address hidden>
 Sent: Tuesday, April 26, 2016 5:27 PM
 Subject: Re: [Question #292422]: how can i be icluded in "sodoers file"

Your question #292422 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/292422

Manfred Hampl posted a new comment:
What you did was not the recommended way, but it will work.
The standard method is adding a user to the sudo group (or eventually to the admin group).
command (to be executed as root or other admin user):
sudo usermod -aG sudo <username>
or
sudo adduser <username> sudo

Doing it this way does not require modifying the sudoers file.

--
You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Your name should not have been added to the sudoers file during installation, but it should have been defined as member of the sudo group. That's how it is supposed to work nowadays.

Revision history for this message
leon antoniadis (leon-antoniadis) said :
#6

The funny side of this story is that I just finished the clean installation on my wife's disk on my laptop with the using the same usb stick and I was not locked out as the same software was loaded peacefullyThanks

      From: Manfred Hampl <email address hidden>
 To: <email address hidden>
 Sent: Wednesday, April 27, 2016 10:52 AM
 Subject: Re: [Question #292422]: how can i be included in "sudoers file"

Your question #292422 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/292422

Manfred Hampl posted a new comment:
Your name should not have been added to the sudoers file during
installation, but it should have been defined as member of the sudo
group. That's how it is supposed to work nowadays.

--
You received this question notification because you asked the question.