Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » External Tools and Sudo(problems using sudo on a bash script)
External Tools and Sudo [message #1405942] Fri, 08 August 2014 15:03 Go to next message
Nelson Teixeira is currently offline Nelson TeixeiraFriend
Messages: 6
Registered: December 2011
Junior Member
Hello, I'm trying to setup a bash script as an external tool. This script, calls 2 other scripts, one of which uses sudo in 2 lines and is called twice. Graphically explaining:
    main 
     | call script1 (has sudo in 2 lines)
     | call script2 (no sudo)
     | call script1 (has sudo in 2 lines)
So what I did was using
SUDO_ASKPASS="/usr/bin/ssh-askpass" sudo -A -v
in the main script and expect script1 would recognize first sudo credentials in both times it runs and in both lines. It works as a charm in the terminal. But when I call it using external tools it pops the password dialog ok, but then I get
sudo: no askpass program specified, try setting SUDO_ASKPASS
sudo: no tty present and no askpass program specified
sudo: pam_authenticate:Authentication information cannot be recovered
twice. One for each time script1 is executed. Substituting
SUDO_ASKPASS="/usr/bin/ssh-askpass" sudo -A -v
by
Gksudo ls > /dev/null
didn't work with the exact same result.

Anyone knows how can I make sudo behave nicely inside Eclipse ?

-Nelson

Re: External Tools and Sudo [message #1406005 is a reply to message #1405942] Fri, 08 August 2014 18:57 Go to previous message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
On Fri, 08 Aug 2014 12:03:36 -0300, Nelson Teixeira wrote:

> Hello, I'm trying to setup a bash script as an external tool. This script, calls 2 other scripts, one of which uses sudo in 2 lines and is called twice. Graphically explaining:
> main
> | call script1 (has sudo in 2 lines)
> | call script2 (no sudo)
> | call script1 (has sudo in 2 lines)
> So what I did was using
> SUDO_ASKPASS="/usr/bin/ssh-askpass" sudo -A -vin the main script and expect script1 would recognize first sudo credentials in both times it runs and in both lines. It works as a charm in the terminal. But when I call it using external tools it pops the password dialog ok, but then I get
> sudo: no askpass program specified, try setting SUDO_ASKPASS
> sudo: no tty present and no askpass program specified
> sudo: pam_authenticate:Authentication information cannot be recoveredtwice. One for each time script1 is executed. Substituting
> SUDO_ASKPASS="/usr/bin/ssh-askpass" sudo -A -vbyGksudo ls > /dev/nulldidn't work with the exact same result.
>
> Anyone knows how can I make sudo behave nicely inside Eclipse ?
>
> -Nelson

I'd think that using "export SUDO_ASKPASS" etc. in the main script
would be sufficient.

If one of the child scripts can't find the env variable
then you might need to export it from your .bashrc, .bash_profile
or .profile, relog, restart eclipse.
Previous Topic:Kepler: On start up, I no longer get prompted for workspace location
Next Topic:How to add selection text count to the status bar
Goto Forum:
  


Current Time: Fri Apr 26 17:45:51 GMT 2024

Powered by FUDForum. Page generated in 0.03021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top