Lubuntu 20: program authentication fails

Asked by Stephen

Lubuntu 20.04 (on notebook PC
1) Click to run a program that normally requires authenitcation pwd entered
- e.g. click firewall gui gufw in start menu
>2) "Authentication required" popup
>3) Enter corect sudo pwd >error:
"Action (usermod) failed executing command as another user: Not authorized"

Workaround =run e.g. sudo gufw in terminal >asks for current sudo user pwd >success, gufw opens.

So sudo rights only fail outside terminal, where sudo command does work.

Confession: probably because I tampered with /etc/sudoers! - silly me! = via visudo in terminal
but I have restored etc/sudoers to same as on my other Lubuntu20.04 desktop PC where NO such problem (prob because I have NOT tampered with its etc/sudoer !)

Any suggestions to how i can fix this? I'm hoping i will not have to reinstall Lubuntu...

Thx hopefully from 3rdRockGuy Stephen

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Stephen (3rdrockstephen) said :

...and user groups = same on problem PC as on non-problem PC

Revision history for this message
Bernard Stafford (bernard010) said (last edit ):

[ctl+alt+t] Terminal: cd /etc/sudoers.d ls -la

drwxr-xr-x 2 root root
drwxr-xr-x 128 root root
-r- -r- - - - - 1 root root

10 places for permissions.
Yours should look like this
File Permissions for sudoers.

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

What is the output of:

groups; lsb_release -a; uname -a


Revision history for this message
Stephen (3rdrockstephen) said :

1) in ans to #3 above from actionparsnip:
Output of
fiddler@LAPST:~$ groups; lsb_release -a; uname -a
fiddler adm cdrom sudo dip plugdev lpadmin sambashare
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Linux LAPST 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Stephen (3rdrockstephen) said :

2) ***(:-))) In reponse to you all: thx for coming back on this so quickly = v impressive.

***Plz note I am not a super techy, just a "diy" (self-taught) non-professional "fiddler", certainly not very familiar with advanced linux lingo.

3) Re #1 above from Bernard...:

your cd /etc/sudoers.d ls -la cmd gives error "bash: too many arguments"

+do you mean run the next 3 lines also in terminal = drw... ?
1 line at a time?

I am not familiar with this perms language altho I am aware of it.

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

There is a typo. Use

cd /etc/sudoers.d; ls -la

That should work

Revision history for this message
Stephen (3rdrockstephen) said :

In reply to Bernard's suggestion in #2 above
= = = = = = = = =

LAPST (what I call the PC with the problem) output (inc. input cmd)= = =

fiddler@LAPST:~$ cd /etc/sudoers.d; ls -la
total 28
drwxr-xr-x 2 root root 4096 Feb 4 2021 .
drwxr-xr-x 139 root root 12288 Nov 25 17:23 ..
-r--r----- 1 root root 20 Feb 4 2021 10-installer
-r--r----- 1 root root 91 Apr 10 2020 99-snapd.conf
-r--r----- 1 root root 958 Feb 3 2020 README

= = = =
So mine looks almost all like you, Bernard, say it should,
except I've got "139" where you've got "128"
***Does this matter?
*** + if so, how do I change to 128?

I know how to change folder o file perms via right-click in file mgr >properties >gui inc. perms tab > change in gui (prob if file mgr ran as root)

Revision history for this message
Stephen (3rdrockstephen) said :

Thx guys for trying to help, + I tried a few other options, but all in vain
- so the last resort got it's turn = I reinstalled Lubuntu
(which was a much more twisty journey than I expected! but succeeded in the end)

=problem solved (or rather, avoided!) by me in the end

Revision history for this message
Stephen (3rdrockstephen) said :

Yay! Solution found =without having to re-install Lubuntu:
1) Boot into grub recovery
  =via esc button during boot *if* UEFI mode in firmware settings
  OR via F" if ...legacy mode
2) >Shell prompt
3) usermod -a -G sudo [username]
  where [username] = user that needs to be put into sudoers grp