webconsole: ssh: each argument on its own line

This commit is contained in:
Yousong Zhou
2020-10-10 14:36:03 +08:00
parent 046e4e3d6c
commit cce2af5010

View File

@@ -129,8 +129,11 @@ func (c *SSHtoolSol) GetCommand() *exec.Cmd {
args := []string{
o.Options.SshpassToolPath, "-p", c.password,
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", // 密码登录时,避免搜寻秘钥登录
"-oNumberOfPasswordPrompts=1",
}
cmd := exec.Command(args[0], args[1:]...)