Skip to content

Commit

Permalink
cmd/sync: the synchronous cluster mode does not support SSH password …
Browse files Browse the repository at this point in the history
…authentication (#5752)
  • Loading branch information
zhijian-pro authored Mar 10, 2025
1 parent 36ea39a commit 1d1353d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sync/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ func launchWorker(address string, config *Config, wg *sync.WaitGroup) {
return
}
rpath := filepath.Join("/tmp", filepath.Base(path))
cmd := exec.Command("rsync", "-au", "-e", "ssh -o PasswordAuthentication=no", path, host+":"+rpath)
cmd := exec.Command("rsync", "-au", "-e", "ssh -o StrictHostKeyChecking=no", "-e", "ssh -o PasswordAuthentication=no", path, host+":"+rpath)
output, err := cmd.CombinedOutput()
logger.Debugf("exec: %s,err: %s", cmd.String(), string(output))
if err != nil {
// fallback to scp
cmd = exec.Command("scp", "-o", "PasswordAuthentication=no StrictHostKeyChecking=no", path, host+":"+rpath)
cmd = exec.Command("scp", "-o", "StrictHostKeyChecking=no", "-o", "PasswordAuthentication=no", path, host+":"+rpath)
output, err = cmd.CombinedOutput()
logger.Debugf("exec: %s,err: %s", cmd.String(), string(output))
}
Expand Down

0 comments on commit 1d1353d

Please sign in to comment.