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
sudo behavior differs in terminal emulators
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?
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?
- sunrat
- 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
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.
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!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: sudo behavior differs in terminal emulators
Let me restate the situation (since you state obvious, and ignore asked):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.
- 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?
- sunrat
- 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
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.
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!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: sudo behavior differs in terminal emulators
Weird. Does gnome-terminal offer the option of opening a login shell? (like "--login" or such).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)...
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?
-
- Posts: 1100
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: sudo behavior differs in terminal emulators
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...
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...
- wizard10000
- 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
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
-- anais nin
Re: sudo behavior differs in terminal emulators
You could always try the sledgehammer method of removing/purging the packages and reinstalling them:
But simulate first to see what gets removed:
Or just get rid of sudo altogether.
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
DebianStable
Code: Select all
$ vrms
No non-free or contrib packages installed on debian! rms would be proud.
- 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
Can we please see the output of these commands from both terminal emulators:
Thanks!
Code: Select all
sudo -l
env
deadbang