ssh-add: can SSH_ASKPASS program require input from stdin?

basher89 basher89 at proton.me
Sun Dec 14 00:53:26 AEDT 2025


Hi,

I have a requirement for an SSH_ASKPASS program that itself asks user
for a password on /dev/stdin. This is due to the fact both the priv
key _and_ its password are accessed from a password manager. Usage
looks like:
$ pwd_mngr get-key | SSH_ASKPASS=3D"pass.sh" ssh-add -

where pass.sh contains: "pwd_mngr get-key-password"

Both calls to pwd_mngr prompt user for a password, that cannot be
worked around. Also the usage is in a non-graphical environment.

Looks like pass.sh is unable to bind to stdin and is immediately closed.

Is there a way to solve this, or am I dealing with an XY problem here?


More information about the openssh-unix-dev mailing list