Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

sudo behavior differs in terminal emulators

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
luboi
Posts: 2
Joined: 2019-11-26 19:49

sudo behavior differs in terminal emulators

#1 Post by luboi »

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?

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: sudo behavior differs in terminal emulators

#2 Post by sunrat »

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!

luboi
Posts: 2
Joined: 2019-11-26 19:49

Re: sudo behavior differs in terminal emulators

#3 Post by luboi »

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?

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: sudo behavior differs in terminal emulators

#4 Post by sunrat »

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!

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: sudo behavior differs in terminal emulators

#5 Post by reinob »

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?

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: sudo behavior differs in terminal emulators

#6 Post by Dai_trying »

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...

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: sudo behavior differs in terminal emulators

#7 Post by wizard10000 »

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

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: sudo behavior differs in terminal emulators

#8 Post by kedaha »

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:
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: sudo behavior differs in terminal emulators

#9 Post by Head_on_a_Stick »

Can we please see the output of these commands from both terminal emulators:

Code: Select all

sudo -l
env
Thanks!
deadbang

Post Reply