The officially official Devuan Forum!

You are not logged in.

#1 2017-07-15 19:45:32

fungus
Member
From: Any witch way
Registered: 2017-07-12
Posts: 497  
Website

Sudo does not work on shells only on guis [SOLVED]

I have installed lxde and anything that runs as a gui when clicked (ie synaptic) asks for "user" pw and works.
Anything in a shell (I mostly use lxterminal) that I try with sudo results:

Sorry, user xxxx is not allowed to execute '/usr/bin/lxtask' as root on mabox

Either through the lxde gui for users and groups or checking sudoers list the user is in sudo group and
other admin tasks.  Can't figure it out and has never happened in other distros before.

su works well but I'd rather not use root as I like to keep the history of commands as a user.
Xfce is still installed from the installation.  Any chance there is a setting in xfce that overpowers
lxde settings?

PS  I am running ascii on amd64

Last edited by fungus (2017-07-16 08:08:46)

Offline

#2 2017-07-16 08:13:38

fungus
Member
From: Any witch way
Registered: 2017-07-12
Posts: 497  
Website

Re: Sudo does not work on shells only on guis [SOLVED]

Ok, 2 things I found that corrected the situation.

1 (Possible bug-fix)  On file /etc/sudoers which we are not allowed to touch, should there be a % sudo  instead of plain sudo?  It worked for me as that is how it was in D***an (systemd)
2  The file in /etc/sudoers.d/shutdown can be eliminated or a # should go on the first line.

This procedure definetely fixededit in my LXDE amd64

Please review if there is a problem doing this, or if it is really a bug it can be fixed.

Offline

#3 2017-07-16 10:03:21

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: Sudo does not work on shells only on guis [SOLVED]

1. Yes, there should be a %sudo line in /etc/sudoers. Mine looks like this:

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL

2. You must have installed from one of the live isos and chosen "use sudo only for shutdown" instead of "use sudo as default".

If those are not both true, then something is wrong or I'm wrong about the situation.

Offline

#4 2017-07-16 10:37:32

fungus
Member
From: Any witch way
Registered: 2017-07-12
Posts: 497  
Website

Re: Sudo does not work on shells only on guis [SOLVED]

My first install run into problems and I did it a second time.  Since I was more comfortable with it I may have overlooked it, although I wouldn't have done it consciously.  So the answer is I am not sure, but since others don't have the same problem it seems likely.  Were there two options or more, and is this the default?  I may have interpret it wrong thinking that it would be a single user no root that is always sudo and I wouldn't want this.

Offline

#5 2017-07-16 23:26:02

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: Sudo does not work on shells only on guis [SOLVED]

There are three choices for the sudo settings:
  - Permit sudo adds the user to the sudo group.
  - Sudo as default does the above, plus edits two files. *
        In ~/.gconf/apps/gksu/%gconf.xml sudo_mode gets set to true
        In ~/.su-to-rootrc  "su" gets changed to "sudo"
  - Sudo only for shutdown adds /etc/sudoers.d/user_shutdown. This is the default setting.

In all cases, if there is a root account, it is not disabled.

*Edit: more than two files. It also looks for kdesurc/tdesurc for KDE or TDE desktops.

Offline

#6 2017-07-17 06:42:49

fungus
Member
From: Any witch way
Registered: 2017-07-12
Posts: 497  
Website

Re: Sudo does not work on shells only on guis [SOLVED]

I am pretty confident my choice would have been the first, but I have made mistakes in the past.
The odd thing is that however I managed to get the user in the sudo group it worked for guis requiring sudo but it would not work within a shell.  I could run synaptic which in lxde requites root priviledges to even browse or update, or mount media from the fm, but $ sudo nano ...file.  was refused.

Offline

Board footer