Well, this is a wordy headline. But if you are running into this problem – like I did – you might search exactly for this and this is called effective seo or something. Here is the premise: You are using Vagrant, like any self-respecting developer would do and you also have soft spot for JetBrains products, i.e. PhpStorm, then you might want to start and stop vagrant directly from your beloved IDE. As you should! You paid good money to be spared from entering commands into a terminal.
But there is a catch: In case some commands are triggered during that process that require sudo
privileges – like the awesome hostupdater-script – you will be greeted by the following message:
sudo: no tty present and no askpass program specified
Now what? I have read some suggestions, that you should change your sudoers
configuration, but that doesn’t seem right. I found a simple solution inside PhpStorm. Go to Settings->Tools->Vagrant
and add SUDO_ASKPASS=/usr/bin/ssh-askpass
to the “Environment variables”.
And next time your sudo password is needed, you will be asked to enter it. On my system, that looks like this:
Ain’t that neat? Of course, if you use Windows or iOS, you might have to adapt the variable accordingly (read: I have no idea what you should do, you’re on your own, buddy).
Hope that helps!
Thanks, bro!
You saved my day
In my ubuntu 17.04 there isn`t this file….
… no such file or directory…
Since you are using Ubuntu, you can easily install ssh-askpass-gnome with
sudo apt-get install ssh-askpass-gnome
This package provides ssh-askpass.
Yes, you right. Thank you!