From 813118fe3e286d3b26ada4184641db95799ccaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Fourrier?= Date: Tue, 11 May 2021 12:19:14 +0200 Subject: [PATCH] Get key passphrase from stdin --- bw_add_sshkeys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bw_add_sshkeys.py b/bw_add_sshkeys.py index 9cd96d6..ce98db4 100644 --- a/bw_add_sshkeys.py +++ b/bw_add_sshkeys.py @@ -4,12 +4,10 @@ Extracts SSH keys from Bitwarden vault """ import argparse -import getpass import json import logging import os import subprocess -import sys from pkg_resources import parse_version @@ -186,6 +184,8 @@ def ssh_add(session, item_id, key_id): subprocess.run( ['ssh-add', '-'], input=ssh_key, + # Works even if ssh-askpass is not installed + env=dict(os.environ, SSH_ASKPASS_REQUIRE="never"), text=True, check=True, )