Recent update reverted /etc/sudoers (maybe?)

If none of the more specific forums is the right place to ask

Recent update reverted /etc/sudoers (maybe?)

Postby HankB » 2017-04-07 13:50

I'm running Stretch RC (AMD_64) and after updating my system (yesterday according to the date on /var/log/dpkg.log) I've lost the ability to `sudo`. I installed without a root login and use `sudo` for all administrative tasks. This morning I'm advidsed " ... is not in the sudoers file. This incident will be reported."

I'm curoius how this happened. I grepped the dpkg log for 'sudo' and found nothing. I did reboot sune time yesterday because the system was getting wonky (programs not running, desktop not responding etc.) I also rebooted when NetworkManager filled my root drive with log messages when a WiFi access point went away. (Grrr...)

Since the update I also installed Wireshark and selected to not require users to run as root. I then used the `newgrp` command as described in this post https://superuser.com/questions/272061/ ... ogging-out to add the group w/out the need to log out. Could that have caused this problem?

I can fix this pretty easily (I think) by booting a live CD and adding myself back to /etc/sudoers but I thought it worth mentioning anyway.

Thanks!

Edit:
On further investigation I found that my user ID had been removed from all groups other than wireshark in /etc/group. Apparently this is the result of executing

Code: Select all
sudo usermod -G wireshark hbarta


I think the correct command would have been.

Code: Select all
sudo usermod -a wireshark hbarta


:oops:

Usually I edit /etc/group manually and perhaps I should stick with that.
HankB
 
Posts: 17
Joined: 2012-03-07 15:15

Re: Recent update reverted /etc/sudoers (maybe?)

Postby Dai_trying » 2017-04-07 21:24

I think the correct command would be
Code: Select all
sudo usermod -a -G wireshark hbarta
at least that's how i do it and it hasn't failed me yet.
Dai_trying
 
Posts: 272
Joined: 2016-01-07 12:25

Re: Recent update reverted /etc/sudoers (maybe?)

Postby cronoik » 2017-04-08 12:18

HankB wrote:I think the correct command would have been.

Code: Select all
sudo usermod -a wireshark hbarta

Just the a parameter doesn't work at all. You need the additional -G parameter like Dai_trying and the manpage suggest's.
Have a nice day!
cronoik
 
Posts: 205
Joined: 2015-05-20 21:17

Re: Recent update reverted /etc/sudoers (maybe?)

Postby HankB » 2017-04-18 13:56

Thank you both for the clarification on the correct command.
HankB
 
Posts: 17
Joined: 2012-03-07 15:15


Return to General Questions

Who is online

Users browsing this forum: FreewheelinFrank and 9 guests

fashionable