ssh-add: can SSH_ASKPASS program require input from stdin?
Carson Gaspar
carson at taltos.org
Sun Dec 14 04:24:30 AEDT 2025
Try something like the following (assuming your shell supports it - bash
does):
sshpass -P assphrase ssh-add <(pwd_mngr get-key)
(I am fetching both key and passphrase from apps, so mine is more like
sshpass -f <(getpassphrase_cmd) -P ...)
On 12/13/2025 7:53 AM, basher89 via openssh-unix-dev wrote:
> 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?
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
More information about the openssh-unix-dev
mailing list