[solved] fish shell vs. sudo

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

[solved] fish shell vs. sudo

Postby kwevej on Tue Mar 08, 2011 6:55 am

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 kwevej on Tue Mar 08, 2011 9:49 am, edited 1 time in total.
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Linux Mint is funded by ads and donations.
 

Re: fish shell vs. sudo

Postby richyrich on Tue Mar 08, 2011 7:16 am

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

Does it do the same when you use su instead ?
User avatar
richyrich
Level 13
Level 13
 
Posts: 4777
Joined: Mon May 04, 2009 8:31 pm
Location: Pirating somewhere along the North Saskatchewan River, Canada

Re: fish shell vs. sudo

Postby kwevej on Tue Mar 08, 2011 7:49 am

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 ;)
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Re: fish shell vs. sudo

Postby viking777 on Tue Mar 08, 2011 8:01 am

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.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: fish shell vs. sudo

Postby kwevej on Tue Mar 08, 2011 8:17 am

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....
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Re: fish shell vs. sudo

Postby kwevej on Tue Mar 08, 2011 9:37 am

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 ....
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Re: fish shell vs. sudo

Postby kwevej on Tue Mar 08, 2011 9:49 am

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
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 3 guests