I want to force ssh to always use the program specified by SSH_ASKPASS
. In my case the program is just a bash script returning the passphrase.
The problem is, as the ssh documentation says:
If ssh needs a passphrase, it will read the passphrase from the current terminal if it was run from a terminal.
So if I run ssh from a terminal, SSH_ASKPASS
is ignored.
There is a similar question: Tell SSH to use a graphical prompt for key passphrase
which proposes create an alias for ssh, like this
$ alias ssh="setsid ssh"
but doesn't work for me, because I don't call ssh directly, is called from git or rsync.
I also found an open issue in the OpenSSH Bugzilla asking for a fix, but was opened in 2002, so I don't believe is going to be implemented.
I'm thinking on probably weird solutions:
- Make a fake ssh agent, which calls the script and returns the passphrase.
- Create a process looking for new ssh processes and detach them from the terminal before ssh asks for the password.
Any better sugestion?
DISPLAY
to some value and thenSSH_ASKPASS
will be used. – npostavs Aug 12 '14 at 00:19DISPLAY
is already set. The question is about forcing SSH to use a GUI passphrase window. I personally would also like to use a (fullscreen) GUI way to provide passphrase but the most of all I would like to provide it once, i.e. I would like to talk to the SSH agent, not to the SSH client. – Pavel Šimerda Jan 31 '15 at 16:55