]> git.proxmox.com Git - pve-cluster.git/blobdiff - src/PVE/SSHInfo.pm
ssh: expose SSH options on their own
[pve-cluster.git] / src / PVE / SSHInfo.pm
index 16ed85a6818f9c9262ea873759f61de067feccb9..168f8fe9ba8151747844196893c24bfe4ea63ff6 100644 (file)
@@ -47,7 +47,7 @@ sub get_ssh_info {
     };
 }
 
-sub ssh_info_to_command_base {
+sub ssh_info_to_ssh_opts {
     my ($info, @extra_options) = @_;
 
     my $nodename = $info->{name};
@@ -62,8 +62,6 @@ sub ssh_info_to_command_base {
     }
 
     return [
-       '/usr/bin/ssh',
-       '-e', 'none',
        '-o', 'BatchMode=yes',
        '-o', 'HostKeyAlias='.$nodename,
        defined($known_hosts_options) ? @$known_hosts_options : (),
@@ -71,6 +69,18 @@ sub ssh_info_to_command_base {
     ];
 }
 
+sub ssh_info_to_command_base {
+    my ($info, @extra_options) = @_;
+
+    my $opts = ssh_info_to_ssh_opts($info, @extra_options);
+
+    return [
+       '/usr/bin/ssh',
+       '-e', 'none', # only works for ssh, not scp!
+       $opts->@*,
+    ];
+}
+
 sub ssh_info_to_command {
     my ($info, @extra_options) = @_;
     my $cmd = ssh_info_to_command_base($info, @extra_options);