]> git.proxmox.com Git - pve-manager.git/commitdiff
pvesh: use SSH command helper
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 11 Jan 2024 10:51:22 +0000 (11:51 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Apr 2024 07:09:44 +0000 (09:09 +0200)
to benefit from future improvements like known host key pinning.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/CLI/pvesh.pm

index 44a65213cdec044519c82cd0b309e322afac2a6e..d373ae29fff8ba0f90a42a9ee7fcb379fdec325c 100755 (executable)
@@ -116,7 +116,7 @@ sub proxy_handler {
        }
     }
 
-    my @ssh_tunnel_cmd = ('ssh', '-o', 'BatchMode=yes', "root\@$remip");
+    my $ssh_tunnel_cmd = PVE::SSHInfo::ssh_info_to_command({ ip => $remip, name => $node });
 
     my @pvesh_cmd = ('pvesh', '--noproxy', $cmd, $path, '--output-format', 'json');
     if (scalar(@$args)) {
@@ -126,7 +126,7 @@ sub proxy_handler {
 
     my $res = '';
     PVE::Tools::run_command(
-       [ @ssh_tunnel_cmd, '--', @pvesh_cmd ],
+       [ $ssh_tunnel_cmd->@*, '--', @pvesh_cmd ],
        errmsg => "proxy handler failed",
        outfunc => sub { $res .= shift },
     );