Skip to content

Commit b62c222

Browse files
committed
debug ssh log after remote set pubkey failed
1 parent 91e79ea commit b62c222

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/job_ssh.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,19 @@ func (m ModJobSshStruct) setupClusterInner(clusterConf clusterconf.ClusterConfYm
322322
}
323323
_ = base64.StdEncoding.EncodeToString(pubkeybytes)
324324

325-
util.StartRemoteCmds(
325+
output, _ := util.StartRemoteCmds(
326326
hosts,
327327
// install telego,
328328
util.ModRunCmd.CmdModels().InstallTelegoWithPy()+" && "+
329329
// update authorized_keys
330330
strings.Join(m.NewSshCmd(SshJob{Mode: SshModeSetupThisNode}.ModeString()), " "),
331331
clusterConf.Global.SshPasswd,
332332
)
333+
if strings.Contains(output[0], "ssh error:") {
334+
fmt.Println(color.RedString("ssh error: %s", output))
335+
// debug sshd_config
336+
util.ModRunCmd.NewBuilder("cat", "/etc/ssh/sshd_config").WithRoot().ShowProgress().BlockRun()
337+
}
333338
}
334339

335340
// https://qcnoe3hd7k5c.feishu.cn/wiki/V6eHwZm1aiofeykaSd5cmgPcnSe#share-Hc1hdGT26oI4I0xPaplcEhMundd

0 commit comments

Comments
 (0)