From 17e39de0218e785f8e28d1367236c8ca49c7e914 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 24 Sep 2024 09:41:07 -0400 Subject: [PATCH] virt-manager: Set SSH_ASKPASS_REQUIRE=force openssh 8.4p1 released in Sep 2020 finally added a feature to force using SSH_ASKPASS instead of prompting on the commandline for password, if a password would be required. https://man.openbsd.org/ssh.1#SSH_ASKPASS_REQUIRE Getting this behavior is basically what our whole fork dance is about. Now we can do it with an environment variable Let the user override it from the environment though, so there's an escape hatch incase this causes unforseen problems Signed-off-by: Cole Robinson --- virtManager/virtmanager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/virtManager/virtmanager.py b/virtManager/virtmanager.py index f60ef8ddb..fb263c838 100644 --- a/virtManager/virtmanager.py +++ b/virtManager/virtmanager.py @@ -185,6 +185,12 @@ def main(): # With F27 gnome+wayland we need to set these before GTK import os.environ["GSETTINGS_SCHEMA_DIR"] = BuildConfig.gsettings_dir + # Force SSH to use askpass if a password is required, + # rather than possibly prompting on a terminal the user isn't looking at. + os.environ.setdefault("SSH_ASKPASS_REQUIRE", "force") + log.debug("Using SSH_ASKPASS_REQUIRE=%s", + os.environ["SSH_ASKPASS_REQUIRE"]) + # Now we've got basic environment up & running we can fork do_drop_stdio = False if not options.no_fork and not options.debug: