From cc37c8232dd5f4e9228ef2ff15ec7220125cf335 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 15 Jun 2020 13:27:35 +0800 Subject: [PATCH] wfvm: improve SSH use --- artiq-fast/wfvm/demo-ssh.nix | 5 +++-- artiq-fast/wfvm/utils.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq-fast/wfvm/demo-ssh.nix b/artiq-fast/wfvm/demo-ssh.nix index 87a5148..ad8a6d9 100644 --- a/artiq-fast/wfvm/demo-ssh.nix +++ b/artiq-fast/wfvm/demo-ssh.nix @@ -6,6 +6,7 @@ in wfvm.utils.wfvm-run { name = "demo-ssh"; image = import ./demo-image.nix { inherit pkgs; }; - display = true; - script = "${pkgs.openssh}/bin/ssh -p 2022 wfvm@localhost"; + script = '' + ${pkgs.sshpass}/bin/sshpass -p1234 -- ${pkgs.openssh}/bin/ssh -p 2022 wfvm@localhost -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null + ''; } diff --git a/artiq-fast/wfvm/utils.nix b/artiq-fast/wfvm/utils.nix index cdb4ae5..ee5fe17 100644 --- a/artiq-fast/wfvm/utils.nix +++ b/artiq-fast/wfvm/utils.nix @@ -17,7 +17,7 @@ rec { ] ++ extraFlags; # Pass empty config file to prevent ssh from failing to create ~/.ssh - sshOpts = "-F /dev/null -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\$TMP/known_hosts -o ConnectTimeout=1"; + sshOpts = "-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=1"; win-exec = pkgs.writeShellScriptBin "win-exec" '' ${pkgs.sshpass}/bin/sshpass -p1234 -- \ ${pkgs.openssh}/bin/ssh -np 2022 ${sshOpts} \