sudo

Asked by LERUSTE

Hi,
I use sudo command properly since several months.
Yesterday, an accident illustrated by an example as follow:
regis@regis-System-Product-Name:~$ sudo shutdown -r now
[sudo] password for regis:
regis is not in the sudoers file. This incident will be reported.
What is the solution ?
Régis

Question information

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

What is the output of:

lsb_release -a; uname -a; groups

Thanks

Revision history for this message
LERUSTE (regis-leruste) said :
#2

Here are:
regis@regis-System-Product-Name:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
regis@regis-System-Product-Name:~$ uname -a
Linux regis-System-Product-Name 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
regis@regis-System-Product-Name:~$ groups
regis bidon
regis@regis-System-Product-Name:~$

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Then you aren't in the admin group so cannot use sudo.

Do you have other accounts that can use sudo? If so then get them to run:

sudo usermod -a -G admin regis

If you log off and on, then regis will be able to use sudo. Looks like you have been messing with group membership and botched it

Revision history for this message
LERUSTE (regis-leruste) said :
#4

Sorry but I Do not have other accounts that can use sudo.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Then use this guide:

http://www.psychocats.net/ubuntu/resetpassword

But instead of resetting the password, add your user back into the admin group using the command in #3

Revision history for this message
LERUSTE (regis-leruste) said :
#6

Hi,
I have read into details "How to reset your password in Ubuntu" and I have a good understanding.
But I do not understand: "add your user back into the admin group using the command in #3"
The procedure is:
passwd username
In my case what can I type ?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

To re-add your user back to the admin group, its the command I gave on my 3rd reply....

You are just using the psychocats guide to get to the root console.....

Revision history for this message
LERUSTE (regis-leruste) said :
#8

Sorry for confusing.
I followed the procedure in recovery mode by using:
mount -o rw,remount /
usermod -a -G admin regis
The result is: the group admin does not exist.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

Then run:

usermod -a -G sudo regis

Revision history for this message
LERUSTE (regis-leruste) said :
#10

Now it is OK
Thanks a lot.