[solved] fish shell vs. sudo

Archived topics about LMDE 1 and LMDE 2
Locked
kwevej

[solved] fish shell vs. sudo

Post by kwevej »

Hi there,

I use fish as my default shell
but - when I use sudo, it asks me to enter password repeatedly, even thou I have sudo timeout set to 15 minutes.

sudo works correctly under bash

Code: Select all

z@pc /t/zTemp> ls
a/  b/
z@pc /t/zTemp> sudo ls
[sudo] password for z:
a  b
z@pc /t/zTemp> sudo ls
[sudo] password for z:
a  b
z@pc /t/zTemp> bash
z@pc /tmp/zTemp $ sudo ls
[sudo] password for z:
a  b
z@pc /tmp/zTemp $ sudo ls
a  b
fish, version 1.23.1

I've contacted fish-user mailing list. Nobody has the same problem.

So, I've booted from LMDE iso - still the same.
Tried to install Debian to VirtualBox - it works!

So there's something wrong with LMDE ...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
richyrich

Re: fish shell vs. sudo

Post by richyrich »

Yea, you should read what they think about sudo in the Debian forums . . :wink:

Does it do the same when you use su instead ?
kwevej

Re: fish shell vs. sudo

Post by kwevej »

richyrich wrote:Yea, you should read what they think about sudo in the Debian forums . . :wink:

Does it do the same when you use su instead ?
Well they are missing some use cases ;) - I use sudo within scripts (backup and others)

su -c ls
- asks for the root password
- asks repeatedly both in LMDE and Debian
...and I guess that's how it should be ;)
viking777

Re: fish shell vs. sudo

Post by viking777 »

kwevej wrote:Hi there,

I use fish as my default shell
but - when I use sudo, it asks me to enter password repeatedly, even thou I have sudo timeout set to 15 minutes.

sudo works correctly under bash

Code: Select all

z@pc /t/zTemp> ls
a/  b/
z@pc /t/zTemp> sudo ls
[sudo] password for z:
a  b
z@pc /t/zTemp> sudo ls
[sudo] password for z:
a  b
z@pc /t/zTemp> bash
z@pc /tmp/zTemp $ sudo ls
[sudo] password for z:
a  b
z@pc /tmp/zTemp $ sudo ls
a  b
fish, version 1.23.1

I've contacted fish-user mailing list. Nobody has the same problem.

So, I've booted from LMDE iso - still the same.
Tried to install Debian to VirtualBox - it works!

So there's something wrong with LMDE ...
I have been using fish for many years on various debain based distros including LMDE and have never run into any problems with sudo. However I think it might depend on what you mean by
I use fish as my default shell
If I read that in the literal sense it means that when you run

Code: Select all

echo $SHELL
it will return something like

Code: Select all

/usr/bin/fish
When I run echo $SHELL, I get output like this:
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
graham@acer ~> echo $SHELL
/bin/bash
I have highlighted in bold type the bits that matter.

To achieve this you want to return to bash as the default shell but run the fish environment on top of it.

This is achieved by changing any program path or shortcut (keyboard or otherwise) to something like the following (I will assume you use gnome-terminal as your terminal of choice, if you don't you will have to alter the command accordingly):

Code: Select all

gnome-terminal -e fish
or for a root terminal

Code: Select all

gksu "gnome-terminal -e fish"
You will get the fish shell every time you start a terminal, but I am prepared to bet you will no longer have any problems with sudo.

Of course if you actually need a fish shell as opposed to just a fish terminal that solution will not work for you. For my purposes a fish terminal is fine.
kwevej

Re: fish shell vs. sudo

Post by kwevej »

yep, i changed the shell by chsh -s /usr/bin/fish for my user.


Tried the same in Debian (console) (chsh) ...sudo works
Tried your recommendation - (before switched back to bash via chsh) ... does not work. (the same result in Guake Terminal)

BUT an interesting case - I've switched to console tty1 ... it works there. Even when fish is the default shell.


...I'll try to install gnome desktop to the Debian and we will see....
kwevej

Re: fish shell vs. sudo

Post by kwevej »

OK so neither Debian (fresh Squeeze installation)....

Code: Select all

test@debian:~$ sudo ls
[sudo] password for test: 
Dokumenty  Hudba  Obrázky  Plocha  Stažené  Šablony  Veřejné  Videa
test@debian:~$ sudo ls
Dokumenty  Hudba  Obrázky  Plocha  Stažené  Šablony  Veřejné  Videa
test@debian:~$ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
test@debian ~> sudo ls
[sudo] password for test: 
Dokumenty  Hudba  Obrázky  Plocha  Stažené  Šablony  Veřejné  Videa
test@debian ~> sudo ls
[sudo] password for test: 
Dokumenty  Hudba  Obrázky  Plocha  Stažené  Šablony  Veřejné  Videa
test@debian ~> 
under console - works
under gnome - does not

So it's even larger problem ....
kwevej

Re: fish shell vs. sudo

Post by kwevej »

OK.... solved by turning tty_tickets off .... blah

Code: Select all

Defaults	env_reset, timestamp_timeout=15, !tty_tickets
reference:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598567

thx all for cooperation
Locked

Return to “LMDE Archive”