sudo behavior differs in terminal emulators

Everything about X, Gnome, KDE, ... and everything running on it

sudo behavior differs in terminal emulators

Postby luboi » 2019-11-26 20:02

Hi, I am evaluating buster and since I am used to gnome-terminal I installed it as the very first step. Unfortunately it behaves very strangely. I cannot run sudo command ... always getting "user is not in the sudoers file. This incident will be reported."
The strange thing is, I can run sudo for the same user from xterm. below output from id

xterm:
id
uid=1000(user) guid=1000(user) groups=1000(user),24(cdrom),25(floppy),27(sudo),29(audio)...

gnome-terminal:
id
uid=1000(user) guid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio)...

any idea what am I doing wrong?
any hint how to fix?
luboi
 
Posts: 2
Joined: 2019-11-26 19:49

Re: sudo behavior differs in terminal emulators

Postby sunrat » 2019-11-26 22:43

sudo is not enabled by default unless you don't set a root password during installation. Learn to use su or add yourself to sudoers like the message says.
There is a multitude of posts about this in the forum. Please search before posting.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: sudo behavior differs in terminal emulators

Postby luboi » 2019-11-27 04:18

sunrat wrote:sudo is not enabled by default unless you don't set a root password during installation. Learn to use su or add yourself to sudoers like the message says.
There is a multitude of posts about this in the forum. Please search before posting.


Let me restate the situation (since you state obvious, and ignore asked):
- root password set during installation,
- user added to sudo group
- sudo working perfectly for exactly the same user on the same system in xterm
- sudo refusing to respect sudo group of aforementioned user in gnome-terminal
- visudo contains following lines
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

questions restated:
how come, in xterm I can use sudo, and in gnome-terminal I cannot?
any idea what am I doing wrong?
any hint how to fix?
luboi
 
Posts: 2
Joined: 2019-11-26 19:49

Re: sudo behavior differs in terminal emulators

Postby sunrat » 2019-11-27 05:20

Apologies for not understanding your question and thank you for explaining it more clearly. So many people have sudo problems for which my answer would apply. Yours does appear to be different.
So my answer to you now is... nfi.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: sudo behavior differs in terminal emulators

Postby reinob » 2019-11-27 06:29

luboi wrote:xterm:
id
uid=1000(user) guid=1000(user) groups=1000(user),24(cdrom),25(floppy),27(sudo),29(audio)...

gnome-terminal:
id
uid=1000(user) guid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio)...


Weird. Does gnome-terminal offer the option of opening a login shell? (like "--login" or such).
Sounds like either that and/or PAM-weirdness causing some groups to be ignored, or (who knows) maybe even gnome-terminal going the extra mile to remove the group on purpose.

Can you try with lxterminal or such?
reinob
 
Posts: 754
Joined: 2014-06-30 11:42

Re: sudo behavior differs in terminal emulators

Postby Dai_trying » 2019-11-27 08:13

I just installed gnome-terminal and it gives identical output to either terminator, xterm, uxterm and xfce-terminal, so I think the problem would be with some configuration change you have made (or has been made).
One other possibility would be if this was a snap/flatpak/appimage or some other standalone type setup, but it hasn't been mentioned so I would guess not...
Dai_trying
 
Posts: 834
Joined: 2016-01-07 12:25

Re: sudo behavior differs in terminal emulators

Postby wizard10000 » 2019-11-27 13:22

OP, did you log off or reboot after adding yourself to sudoers?
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 104
Joined: 2019-04-16 23:15
Location: southeastern us

Re: sudo behavior differs in terminal emulators

Postby kedaha » 2019-11-27 14:03

You could always try the sledgehammer method of removing/purging the packages and reinstalling them:
But simulate first to see what gets removed:
Code: Select all
$ apt -s remove --purge gnome-terminal sudo

Code: Select all
# apt remove --purge gnome-terminal sudo

Code: Select all
# apt install gnome-terminal sudo

Or just get rid of sudo altogether. :wink:
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3034
Joined: 2008-05-24 12:26

Re: sudo behavior differs in terminal emulators

Postby Head_on_a_Stick » 2019-11-28 16:49

Can we please see the output of these commands from both terminal emulators:
Code: Select all
sudo -l
env

Thanks!
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable