首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Lsyncd权限被拒绝(publickey,password)

Lsyncd权限被拒绝(publickey,password)
EN

Stack Overflow用户
提问于 2014-12-07 20:02:51
回答 1查看 4.3K关注 0票数 4

我正在设置自动同步本地和远程文件夹的lsyncd。我已经研究了许多可用的解决方案,也向conf文件添加了额外的参数。我还用PermitRootLogin without-password更新了sshd_config

此外,我可以使用密码ssh,也可以不手动尝试使用密码进行rsync,但问题是当我通过lsyncd使用它时,它会给出权限拒绝错误3次,然后退出(看起来像是要求输入密码)。

lsyncd.conf.lua文件

代码语言:javascript
复制
settings {
        logfile = "/var/log/lsyncd/lsyncd.log",
        statusFile = "/var/log/lsyncd/lsyncd.status",
        statusInterval = 10
}
sync {
    default.rsync,
    source="/home/gaurav/Desktop/source/",
    target="root@xxx.xxx.xx.xxx:/root/destination/",
    rsync = {
        compress = true,
        acls = true,
        verbose = true,
        _extra = {"-P", "-e", "/usr/bin/ssh -p 22 -i /home/gaurav/.ssh/id_rsa -o StrictHostKeyChecking=no"}
    }
}

我也尝试过这个。

代码语言:javascript
复制
settings = {
    logfile = "/var/log/lsyncd/lsyncd.log",
    statusFile = "/var/log/lsyncd/lsyncd.status"
}

sync {
    default.rsyncssh,
    source = "/home/gaurav/Desktop/source/",
    host = "xxx.xxx.xx.xxx",
    targetdir = "/root/destination/"
}

日志

代码语言:javascript
复制
Sun Dec  7 17:18:09 2014 Normal: recursive startup rsync: /home/gaurav/Desktop/source/ -> root@xxx.xxx.xx.xxx:/root/destination/
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]
Sun Dec  7 17:18:12 2014 Error: Temporary or permanent failure on startup of "/home/gaurav/Desktop/source/". Terminating since "insist" is not set.
EN

回答 1

Stack Overflow用户

发布于 2017-01-13 22:10:36

如果你使用的是ubuntu12.04,你必须使用rsyncOps代替rsync = {}块。

试试这个:

代码语言:javascript
复制
sync { 
  default.rsync, 
  source="/var/www/",
  target=server..":/var/www/",
  excludeFrom="/etc/lsyncd/lsyncd-excludes.txt",
  rsyncOps={"-e", "/usr/bin/ssh -o StrictHostKeyChecking=no", "-avz"}
}

https://www.stephenrlang.com/2015/12/how-to-install-and-configure-lsyncd/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27342407

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档