2014-12-07 819 views
2

我在lsyncd上设置自动同步本地和远程文件夹。我已经研究了许多可用的解决方案,还为conf文件添加了额外的参数。 我也更新了与PermitRootLogin without-passwordLsyncd权限被拒绝(公钥,密码)

而且sshd_config中,我能够用密码SSH和也rsync的无密码手动尝试,但问题是,当我使用它通过lsyncd它赋予权限拒绝错误3次,并退出(好像它要求输入密码)。

lsyncd.conf.lua文件

settings { 
     logfile = "/var/log/lsyncd/lsyncd.log", 
     statusFile = "/var/log/lsyncd/lsyncd.status", 
     statusInterval = 10 
} 
sync { 
    default.rsync, 
    source="/home/gaurav/Desktop/source/", 
    target="[email protected]:/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"} 
    } 
} 

与这其中也也试过。

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/" 
} 

日志

Sun Dec 7 17:18:09 2014 Normal: recursive startup rsync: /home/gaurav/Desktop/source/ -> [email protected]:/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. 

回答

相关问题