From 79f0c66c48b14c389977b6440f6d3505dd83fbc0 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sat, 10 Oct 2020 14:36:03 +0800 Subject: [PATCH 1/2] webconsole: ssh: each argument on its own line --- pkg/webconsole/command/ssh_command.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/webconsole/command/ssh_command.go b/pkg/webconsole/command/ssh_command.go index b42aa079aa..49e0fa807c 100644 --- a/pkg/webconsole/command/ssh_command.go +++ b/pkg/webconsole/command/ssh_command.go @@ -156,8 +156,11 @@ func (c *SSHtoolSol) GetData(data string) (isShow bool, ouput string, command st args := []string{ o.Options.SshpassToolPath, "-p", data, o.Options.SshToolPath, "-p", fmt.Sprintf("%d", c.Port), fmt.Sprintf("%s@%s", c.Username, c.IP), - "-oGlobalKnownHostsFile=/dev/null", "-oUserKnownHostsFile=/dev/null", "-oStrictHostKeyChecking=no", - "-oPreferredAuthentications=password", "-oPubkeyAuthentication=no", //密码登录时,避免搜寻秘钥登录 + "-oGlobalKnownHostsFile=/dev/null", + "-oUserKnownHostsFile=/dev/null", + "-oStrictHostKeyChecking=no", + "-oPreferredAuthentications=password", + "-oPubkeyAuthentication=no", //密码登录时,避免搜寻秘钥登录 } return true, "", strings.Join(args, " ") } From 0f4b8e79ac45d5cb60e11bc1bfc2be4a8b40a728 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sat, 10 Oct 2020 14:36:36 +0800 Subject: [PATCH 2/2] webconsole: ssh: add keyboard-interactive as an option For ESXi 6.0 Authentications that can continue: publickey,keyboard-interactive --- pkg/webconsole/command/ssh_command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/webconsole/command/ssh_command.go b/pkg/webconsole/command/ssh_command.go index 49e0fa807c..609df2afb3 100644 --- a/pkg/webconsole/command/ssh_command.go +++ b/pkg/webconsole/command/ssh_command.go @@ -159,7 +159,7 @@ func (c *SSHtoolSol) GetData(data string) (isShow bool, ouput string, command st "-oGlobalKnownHostsFile=/dev/null", "-oUserKnownHostsFile=/dev/null", "-oStrictHostKeyChecking=no", - "-oPreferredAuthentications=password", + "-oPreferredAuthentications=password,keyboard-interactive", "-oPubkeyAuthentication=no", //密码登录时,避免搜寻秘钥登录 } return true, "", strings.Join(args, " ")