|
Re: External Tools and Sudo [message #1406005 is a reply to message #1405942] |
Fri, 08 August 2014 18:57 |
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds