Using Yad for ssh-askpass

1 Mins read
OpenSSH

ssh-askpass is an X11 application for passing a user’s SSH Key passphrase to ssh-add ssh-add(1). But it only works with X11. And I’m on Wayland now.

Solution

Yad. Yad is Yet Another Dialog ala Zenity or Dialog. It allows for taking in input and passing it to something else in a similar way to the way ssh-askpass worked with X11.

A screenshot

This is how my yad-askpass window looks:

yad-askpass

The code

I run yad_askpass out of my $HOME/.local/bin directory.

The script looks like this:

#!/bin/sh

ontop='--on-top'
unset css
width=350

/usr/bin/yad --title 'Enter SSH Key Passphrase' $ontop --css "$css" --width $width --center \
  --fixed --entry --hide-text --entry-label='Enter SSH Key passphrase'

Since I have my screenlocker forget my SSH Passphrases and lock my ssh keys whenever my screen locks, I end up typing this password 20 times a day (at least).