Files are not sync with lsyncd in linux Server

Fresh installed lsyncd 2.2.3 version in ubuntu server.
Then I created manually both lsyncd.conf.lua and lsyncd log files in /etc/lsyncd/ and /var/log/lsyncd respectively.

But files are not syncing to target server.

I checked lsyncd.log file and getting below errors:

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
Host key verification failed.

For Host key verification failed I tried these commands but no success

Generate SSH Key Pair on the Client Server:

ssh-keygen -t rsa

Copy the Public Key to the Remote Server:

ssh-copy-id user@remote_server

Test SSH Connection:

ssh user@remote_server

@does a plain rsync command work ?

Please show the complete output of the command ssh user@remote_host (and eventually more necessary ssh options) using the the same target hostname and target username you are using in lsyncd.conf.lua, starting from the same originating user as you do with lsyncd.

The cause of this message is, that the host key of the target host is not known to the ssh-client, where your lsyncd is originated from. Maybe - unklikely - the host key has changed. More likely the host key has just not been accepted/added to the originating users ~/.ssh/known_hosts so far.

Yes , I can do ssh to my target server without password.

administrator@wei-az-web14:/etc/lsyncd$ ssh administrator@ 10.188.11.38
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64)

Last login: Mon Nov 20 05:36:21 2023 from 192.168.99.158
administrator@wei-az-web12 :~$

Can you show your lsyncd.lua.conf? (Please anonymize your data if necessary)

How is lsyncd started in your case?

Please also show the complete log+output of your lsyncd call (you can start lsyncd with -nodaemon option to have it in foreground) - the prompt of the starting user included.

@vrohilla ,

?

settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
statusInterval = 10,
insist = true,
}

sync {
default.rsyncssh,
source = "/dev/datadrive/openlightbox.com/",
host = "ip address",
targetdir = "/dev/datadrive/openlightbox.com/",
delay = 5,
}

sync {
default.rsyncssh,
source = "/dev/v2av2datadrive/v2.av2books.com/",
host = "ip address",
targetdir = "/dev/v2av2datadrive/v2.av2books.com/",
delay = 5,
}

@munkeHoller
Since vrohilla showed an ssh command working seamlessly, I assume using a plain rsync will do the same way, because the error he got is an ssh (host verification) error. But doublechecking is a good thing too.

And I also ask for the other two of my questions:

  • How is lsyncd started in your case?
  • Please also show the complete log+output of your lsyncd call (you can start lsyncd with -nodaemon option to have it in foreground) - the prompt of the starting user included.

@joker,

Thing is , we don't assume, proof is all that is required, everything else is speculation regardless of what we might think/believe. The user has not shown any commands executed - saying 'it works' is simply not good enough, showing commands executed .... resultant outputs/logs supporting are all that's required. If the ssh is sucessful but the rsync is throwing an error then one or both have an issue somewhere.

Sample output the user posted also looks suspicious (as per below)- there is a space between administrator@ and the ipaddr 10.188.11.38 ... in my experience this wouldn't work. this could be nothing more than a copy/paste error ... but I'm yet to be convinced.


administrator@wei-az-web14:/etc/lsyncd$ ssh administrator@ 10.188.11.38
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64)

Last login: Mon Nov 20 05:36:21 2023 from 192.168.99.158
administrator@wei-az-web12 :~$

Anyways, as is there's little that can be done until the user supplies evidence as requested.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.