I've lost sudo access and I don't really understand why

Karl Auer kauer at biplane.com.au
Wed Mar 18 22:18:14 UTC 2020


On Wed, 2020-03-18 at 21:28 +0000, Chris Green wrote:
> So (unless using the -a option) usermod removes group membership that
> isn't specifically stated.  Surely there's an easier way to add
> oneself to an extra group.

It's not that tricky - the -G option sets the list of groups the user
should belong to. If you want to APPEND that list to the list of groups
the user ALREADY belongs to, specify -a as well.

Which is more dangerous - to permit a person with sudo access to lose
it by mistake, or to permit a person who should not have access to
certain groups to retain them by mistake? usermod says it's the former,
and thus makes "don't append" the default.

Personally I almost always modify /etc/groups directly (i.e., with a
text editor) unless the operation is scripted. It has never failed me
in well over 30 years of Unixing.

If it really worries you, set up an alias that does a group append for
you.

Regards, K.
 
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D






More information about the ubuntu-users mailing list