From ea5255d440cd1094a40b378f81296f11df6e20ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Wed, 22 Nov 2023 21:47:55 +0100 Subject: [PATCH] Use SSH address also for copy command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- cmd/limactl/copy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/limactl/copy.go b/cmd/limactl/copy.go index ca6465873c9..2cb9be8aa96 100644 --- a/cmd/limactl/copy.go +++ b/cmd/limactl/copy.go @@ -87,9 +87,9 @@ func copyAction(cmd *cobra.Command, args []string) error { } if legacySSH { scpFlags = append(scpFlags, "-P", fmt.Sprintf("%d", inst.SSHLocalPort)) - scpArgs = append(scpArgs, fmt.Sprintf("%s@127.0.0.1:%s", u.Username, path[1])) + scpArgs = append(scpArgs, fmt.Sprintf("%s@%s:%s", u.Username, inst.SSHAddress, path[1])) } else { - scpArgs = append(scpArgs, fmt.Sprintf("scp://%s@127.0.0.1:%d/%s", u.Username, inst.SSHLocalPort, path[1])) + scpArgs = append(scpArgs, fmt.Sprintf("scp://%s@%s:%d/%s", u.Username, inst.SSHAddress, inst.SSHLocalPort, path[1])) } instDirs[instName] = inst.Dir default: